Apache Shiro 在 Tomcat 重启 Oracle sql db 后未通过身份验证
Apache Shiro is not Authenticated in Tomcat afetr restart Oracle sql db
##Shiro config file
##IronOne Technologies (Pvt) Ltd
[main]
##creating the realm
jdbcRealm=org.apache.shiro.realm.jdbc.JdbcRealm
jdbcRealm.permissionsLookupEnabled = true
## jdbcRealm.authenticationQuery = SELECT password FROM users WHERE username = ?
## jdbcRealm.userRolesQuery = SELECT rolename FROM userroles WHERE username = ?
## jdbcRealm.permissionsQuery = SELECT permission FROM rolepermissions WHERE roleid=(SELECT roleid from roles where rolename= ? )
jdbcRealm.authenticationQuery = SELECT password FROM users WHERE UPPER(LOGIN_ID) = UPPER(?)
jdbcRealm.userRolesQuery = SELECT ROLE_ID FROM users WHERE UPPER(LOGIN_ID) = UPPER(?)
##jdbcRealm.connectionTmeout = 60
##connection pooling and database access through apache commons dbcp
## ds = src.com.ironone.backoffice.controller.shiro.ShiroBasicDataSource
ds = org.apache.commons.dbcp.BasicDataSource
ds.driverClassName = oracle.jdbc.driver.OracleDriver
ds.username=BACKOFFICE
ds.password =backoffice
ds.url = jdbc:oracle:thin:@192.168.25.27:1521:orcl
securityManager.rememberMeManager.cipherKey = kPH+bIxk5D2deZiIxcaaaA==
##adding the data source to the realm earlier configured
jdbcRealm.dataSource = $ds
##password encryption is done by sha256 encryption algorithm provided by shiro api
Md5Matcher = org.apache.shiro.authc.credential.Md5CredentialsMatcher
jdbcRealm.credentialsMatcher = $Md5Matcher
##configuring security manager to use the realm configured earlier
securityManager.realms=$jdbcRealm
##Caching mechanism is dome by a third party chaching api called ehcache
##adding the chaching support to the security manager
## cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
## securityManager.cacheManager = $cacheManager
## rememberMeManager = src.com.ironone.backoffice.controller.shiro.MyRememberMeManager
## securityManager.rememberMeManager = $rememberMeManager
## sessionManager = src.com.ironone.backoffice.controller.shiro.CustomSecurityManager
logout = src.com.ironone.backoffice.controller.shiro.MyLogoutFilter
[filters]
## authcBasic.loginUrl =/home_
## authcBasic.successUrl = /home
## logout.redirectUrl =/logoutc
##url section is used to set permissions to specific urls
[urls]
/logout = logout
/login = anon
/= anon
/login.jsp = anon
/home=anon
/jquery.js = anon
/js/shiro_logout.js = anon
/atrad_style.css = anon
/FooterFile.css = anon
/Img/loginImage/* = anon
/Img/top_bck.gif = anon
/Img/top_curve_front.gif = anon
/Img/atrad_backOffice_logo.png = anon
/Img/top_curve_end.gif = anon
/Img/nav_panel_bck.jpg = anon
/Img/but_bck.jpg = anon
/LoginController=anon
/login_=anon
/js = anon
/** = authc
## /** = authcBasic
我将 ds.validationQuery = select 1 from dual
部分添加到 shiro.ini 这么大的文件已修复
ds.driverClassName = oracle.jdbc.driver.OracleDriver
ds.username=<schima name>
ds.password=<password-here>
ds.url = jdbc:oracle:thin:@127.0.0.1:1521:orcl
ds.validationQuery = select 1 from dual
##Shiro config file
##IronOne Technologies (Pvt) Ltd
[main]
##creating the realm
jdbcRealm=org.apache.shiro.realm.jdbc.JdbcRealm
jdbcRealm.permissionsLookupEnabled = true
## jdbcRealm.authenticationQuery = SELECT password FROM users WHERE username = ?
## jdbcRealm.userRolesQuery = SELECT rolename FROM userroles WHERE username = ?
## jdbcRealm.permissionsQuery = SELECT permission FROM rolepermissions WHERE roleid=(SELECT roleid from roles where rolename= ? )
jdbcRealm.authenticationQuery = SELECT password FROM users WHERE UPPER(LOGIN_ID) = UPPER(?)
jdbcRealm.userRolesQuery = SELECT ROLE_ID FROM users WHERE UPPER(LOGIN_ID) = UPPER(?)
##jdbcRealm.connectionTmeout = 60
##connection pooling and database access through apache commons dbcp
## ds = src.com.ironone.backoffice.controller.shiro.ShiroBasicDataSource
ds = org.apache.commons.dbcp.BasicDataSource
ds.driverClassName = oracle.jdbc.driver.OracleDriver
ds.username=BACKOFFICE
ds.password =backoffice
ds.url = jdbc:oracle:thin:@192.168.25.27:1521:orcl
securityManager.rememberMeManager.cipherKey = kPH+bIxk5D2deZiIxcaaaA==
##adding the data source to the realm earlier configured
jdbcRealm.dataSource = $ds
##password encryption is done by sha256 encryption algorithm provided by shiro api
Md5Matcher = org.apache.shiro.authc.credential.Md5CredentialsMatcher
jdbcRealm.credentialsMatcher = $Md5Matcher
##configuring security manager to use the realm configured earlier
securityManager.realms=$jdbcRealm
##Caching mechanism is dome by a third party chaching api called ehcache
##adding the chaching support to the security manager
## cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
## securityManager.cacheManager = $cacheManager
## rememberMeManager = src.com.ironone.backoffice.controller.shiro.MyRememberMeManager
## securityManager.rememberMeManager = $rememberMeManager
## sessionManager = src.com.ironone.backoffice.controller.shiro.CustomSecurityManager
logout = src.com.ironone.backoffice.controller.shiro.MyLogoutFilter
[filters]
## authcBasic.loginUrl =/home_
## authcBasic.successUrl = /home
## logout.redirectUrl =/logoutc
##url section is used to set permissions to specific urls
[urls]
/logout = logout
/login = anon
/= anon
/login.jsp = anon
/home=anon
/jquery.js = anon
/js/shiro_logout.js = anon
/atrad_style.css = anon
/FooterFile.css = anon
/Img/loginImage/* = anon
/Img/top_bck.gif = anon
/Img/top_curve_front.gif = anon
/Img/atrad_backOffice_logo.png = anon
/Img/top_curve_end.gif = anon
/Img/nav_panel_bck.jpg = anon
/Img/but_bck.jpg = anon
/LoginController=anon
/login_=anon
/js = anon
/** = authc
## /** = authcBasic
我将 ds.validationQuery = select 1 from dual
部分添加到 shiro.ini 这么大的文件已修复
ds.driverClassName = oracle.jdbc.driver.OracleDriver
ds.username=<schima name>
ds.password=<password-here>
ds.url = jdbc:oracle:thin:@127.0.0.1:1521:orcl
ds.validationQuery = select 1 from dual