Skip to content

Instantly share code, notes, and snippets.

@dominicfarr
Last active March 9, 2021 05:37
Show Gist options
  • Save dominicfarr/9637357 to your computer and use it in GitHub Desktop.
Save dominicfarr/9637357 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
@yanko
Copy link

yanko commented Feb 8, 2021

Hey @suchitgupta01,
good question, I have not had the need for it, so I dont know but a quick search got me these, hope it helps!

secure-database-password-in-shiro-ini
shiro-command-line-hasher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment