remember me - Apache Shiro: RememberMe feature doesn't work with default password service -
remember me - Apache Shiro: RememberMe feature doesn't work with default password service -
i developing jsf-based project using apache shiro 1.2 security. have problem 'remember me' feature.
[main] jdbcrealm=org.apache.shiro.realm.jdbc.jdbcrealm jdbcrealm.authenticationquery = select password user username = ? jdbcrealm.userrolesquery = select role userroles userid = (select id user username = ?) ds = com.mysql.jdbc.jdbc2.optional.mysqldatasource ds.servername = localhost ds.user = root ds.password = 12345 ds.databasename = testdb jdbcrealm.datasource= $ds authc.loginurl = /index.xhtml user.loginurl = /index.xhtml passwordservice = org.apache.shiro.authc.credential.defaultpasswordservice passwordmatcher = org.apache.shiro.authc.credential.passwordmatcher passwordmatcher.passwordservice = $passwordservice jdbcrealm.credentialsmatcher = $passwordmatcher #or configuration #passwordmatcher = org.apache.shiro.authc.credential.sha256credentialsmatcher #credentialsmatcher = org.apache.shiro.authc.credential.hashedcredentialsmatcher #credentialsmatcher.hashalgorithmname = sha-256 #credentialsmatcher.storedcredentialshexencoded = true #credentialsmatcher.hashiterations = 5000
java class
passwordservice passwordservice = new defaultpasswordservice(); string encryptedpassword = passwordservice.encryptpassword(password); subject currentuser = securityutils.getsubject(); usernamepasswordtoken token = new usernamepasswordtoken(username, encryptedpassword); token.setrememberme(rememberme);
what problem be?
you need configure default session manager hold session remembering.
[main] sessionmanager = org.apache.shiro.web.session.mgt.defaultwebsessionmanager securitymanager.sessionmanager = $sessionmanager
shiro remember-me
Comments
Post a Comment