2017-04-08 11:55:33,010 WARN [Org.apache.shiro.mgt.AbstractRememberMeManager]-there is a failure while trying to retrie ve remembered principals. This could is due to a configuration problem or corrupted principals. This could also is due to a recently changed encryption key, if you is using a Shiro.ini file, this property would is ' SE CurityManager.rememberMeManager.cipherKey ' See:http://shiro.apache.org/web.html#web-remembermeservices. The remembered identity would be forgotten and not used for this request. 2017-04-08 11:55:33,023 WARN [Org.apache.shiro.mgt.DefaultSecurityManager]-Delegate Remembermemanager instance of Type [Org.apache.shiro.web.mgt.CookieRememberMeManager] threw an exception during getrememberedprincipals (). Org.apache.shiro.crypto.CryptoException:Unable to execute ' dofinal ' with cipher instance [[email protected]].at Org.apache.shiro.crypto.JcaCipherService.crypt (jcacipherservice.java:462) at Org.apache.shiro.crypto.JcaCipherService.crypt (Jcacipherservice. java:445) at Org.apache.shiro.crypto.JcaCipherService.decrypt (jcacipherservice.java:390) at Org.apache.shiro.crypto.JcaCipherService.decrypt (jcacipherservice.java:382) at Org.apache.shiro.mgt.AbstractRememberMeManager.decrypt (abstractremembermemanager.java:482) at Org.apache.shiro.mgt.AbstractRememberMeManager.convertBytesToPrincipals (abstractremembermemanager.java:419) at Org.apache.shiro.mgt.AbstractRememberMeManager.getRememberedPrincipals (abstractremembermemanager.java:386) at Org.apache.shiro.mgt.DefaultSecurityManager.getRememberedIdentity (defaultsecuritymanager.java:604) at Org.apache.shiro.mgt.DefaultSecurityManager.resolvePrincipals (defaultsecuritymanager.java:492) at Org.apache.shiro.mgt.DefaultSecurityManager.createSubject (defaultsecuritymanager.java:342) at Org.apache.shiro.subject.subject$builder.buildsubject (subject.java:846) at Org.apache.shiro.web.subject.websubject$builder.buildwebsubject (websubject.java:148) at Org.apache.shiro.web.servlet.AbstractShiroFilter.createSubject (Abstractshirofilter.java:292) at Org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal ( abstractshirofilter.java:359) at Org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter ( onceperrequestfilter.java:125) at Org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate ( delegatingfilterproxy.java:346) at Org.springframework.web.filter.DelegatingFilterProxy.doFilter ( delegatingfilterproxy.java:262) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter ( applicationfilterchain.java:241) at Org.apache.catalina.core.ApplicationFilterChain.doFilter ( applicationfilterchain.java:208) at Org.apache.catalina.core.StandardWrapperValve.invoke ( standardwrappervalve.java:218) at Org.apache.catalina.core.StandardContextValve.invoke (Standardcontextvalve.java : 122) at Org.apache.catalina.authenticator.AuthenticatorBase.invoke (authenticatorbase.java:505) at Org.apache.catalina.core.StandardHostValve.invoke (standardhostvalve.java:169) at Org.apache.catalina.valves.ErrorReportValve.invoke (errorreportvalve.java:103) at Org.apache.catalina.valves.AccessLogValve.invoke (accesslogvalve.java:956) at Org.apache.catalina.core.StandardEngineValve.invoke (standardenginevalve.java:116) at Org.apache.catalina.connector.CoyoteAdapter.service (coyoteadapter.java:442) at Org.apache.coyote.http11.AbstractHttp11Processor.process (abstracthttp11processor.java:1082) at Org.apache.coyote.abstractprotocol$abstractconnectionhandler.process (abstractprotocol.java:623) at Org.apache.tomcat.util.net.jioendpoint$socketprocessor.run (jioendpoint.java:316) at Java.util.concurrent.ThreadPoolExecutor.runWorker (threadpoolexecutor.java:1145) at Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:615) at Org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run (taskthread.java:61) at Java.lang.Thread.run ( thread.java:745) caused By:javax.crypto.BadPaddingException:Given final block not properly paddedat Com.sun.crypto.provider.CipherCore.doFinal (ciphercore.java:811) at Com.sun.crypto.providEr. Ciphercore.dofinal (ciphercore.java:676) at Com.sun.crypto.provider.AESCipher.engineDoFinal (aescipher.java:313) at Javax.crypto.Cipher.doFinal (cipher.java:2087) at Org.apache.shiro.crypto.JcaCipherService.crypt ( jcacipherservice.java:459) ... More
Workaround:
Add a custom realm
<property name= "storedcredentialshexencoded" value= "true"/>
1 <BeanID= "Sha1realm"class= "Cn.lonecloud.realms.SHA1Realm">2 <!--Configuring encryption Algorithms -3 < Propertyname= "Credentialsmatcher">4 <!--Shiro Encryption Policy MD5 -5 <Beanclass= "Org.apache.shiro.authc.credential.HashedCredentialsMatcher">6 <!--Encryption Policy -7 < Propertyname= "Hashalgorithmname"value= "SHA1"/>8 <!--Number of encryption -9 < Propertyname= "Hashiterations"value= "Ten"/>Ten < Propertyname= "storedcredentialshexencoded"value= "true"/> One </Bean> A </ Property> - </Bean>
Shiro Error-[org.apache.shiro.mgt.abstractremembermemanager]-there is a failure while trying to retrieve remembered Princi Pals.