Skip to content

Instantly share code, notes, and snippets.

@sohlich
Forked from dominicfarr/shiro.ini
Created August 6, 2016 10:44
Show Gist options
  • Save sohlich/c43d1838f958945d13414650cccec380 to your computer and use it in GitHub Desktop.
Save sohlich/c43d1838f958945d13414650cccec380 to your computer and use it in GitHub Desktop.
example jdbcRealm configured in shiro.ini
[main]
ds = com.mysql.jdbc.Driver
ds.serverName = localhost
ds.user = user
ds.password = password
ds.databaseName = db_name
jdbcRealm = org.apache.shiro.realm.jdbc.JdbcRealm
jdbcRealm.dataSource = $ds
jdbcRealm.permissionsLookupEnabled = true
jdbcRealm.authenticationQuery = "SELECT password FROM users WHERE user_name = ?"
jdbcRealm.userRolesQuery = "SELECT role_name FROM user_rolesWHERE user_name = ?"
jdbcRealm.permissionsQuery = "SELECT permission FROM roles_permissions WHERE role_name = ?"
authc = org.apache.shiro.web.filter.authc.PassThruAuthenticationFilter
authc.loginUrl = /login/
[urls]
/login/ = authc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment