RemeberMe fix

上级 6e62782b
package org.maxkey.authn;
import org.maxkey.authn.realm.AbstractAuthenticationRealm;
import org.maxkey.authn.support.jwt.JwtLoginService;
import org.maxkey.authn.support.rememberme.AbstractRemeberMeService;
import org.maxkey.config.ApplicationConfig;
import org.maxkey.constants.LOGINTYPE;
......@@ -47,10 +46,6 @@ public abstract class AbstractAuthenticationProvider{
@Qualifier("remeberMeService")
protected AbstractRemeberMeService remeberMeService;
/* @Autowired
@Qualifier("jwtLoginService")
JwtLoginService jwtLoginService;
*/
protected abstract String getProviderName();
protected abstract Authentication doInternalAuthenticate(Authentication authentication);
......
......@@ -60,7 +60,9 @@ public class RealmAuthenticationProvider extends AbstractAuthenticationProvider
*/
WebContext.setUserInfo(userInfo);
if(applicationConfig.getLoginConfig().isRemeberMe()){
auth.setAuthenticated(true);
if(auth.isAuthenticated()&&applicationConfig.getLoginConfig().isRemeberMe()){
if(auth.getJ_remeberme()!=null&&auth.getJ_remeberme().equals("remeberMe")){
WebContext.getSession().setAttribute(WebConstants.REMEBER_ME_SESSION,auth.getJ_username());
_logger.debug("do Remeber Me");
......@@ -71,7 +73,6 @@ public class RealmAuthenticationProvider extends AbstractAuthenticationProvider
}
}
auth.setAuthenticated(true);
UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken =new UsernamePasswordAuthenticationToken(
auth,
"PASSWORD",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册