Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What database tables does Apache Shiro require?

Tags:

java

apache

shiro

I want to use Apache Shiro and MySQL for my Realm. What tables and fields does Shiro need to work?

like image 710
mehdi shahdoost Avatar asked Mar 30 '11 12:03

mehdi shahdoost


People also ask

How does Apache Shiro work?

Apache Shiro's design goals are to simplify application security by being intuitive and easy to use. Shiro's core design models how most people think about application security - in the context of someone (or something) interacting with an application. Software applications are usually designed based on user stories.

What is Shiro ini file?

The [users] section of the shiro. ini config file defines the user credentials that are recognized by the SecurityManager. The format is: principal (username) = password, role1, role2, …, role. The roles and their associated permissions are declared in the [roles] section.

What is Shiro filter?

Although Apache Shiro is designed to be used to secure any JVM-based application, it is most commonly used to secure a web application. It greatly simplifies how you secure web applications base on simple URL pattern matching and filter chain definitions.

What is realm Shiro?

A Realm is essentially a security-specific DAO. Because most of these data sources usually store both authentication data (credentials such as passwords) as well as authorization data (such as roles or permissions), every Shiro Realm can perform both authentication and authorization operations.


1 Answers

Shiro doesn't require database tables to function. Shiro users can use whatever datastore they want to model or manage users, groups, permissions etc.

It is a Shiro Realm's responsibility to act as the bridge to your data (however you want to represent it) and return it in a format that Shiro understands.

Because Shiro does not impose a data model upon you, this is what allows it to work with so many backends (LDAP, Active Directory, RDBMS, File System, etc).

If you want to use an RDBMS as your backing data store, check out Shiro's JdbcRealm source code to give you an idea of what your tables might look like. This is just an example though. You could have any table structure you wish.

like image 100
Les Hazlewood Avatar answered Oct 16 '22 20:10

Les Hazlewood