return dto;
}
}
OpenIDRememberMeDO rememberMe = null;
OpenIDRememberMeDAO dao = null;
String token = null;
tenantUser = UserCoreUtil.getTenantLessUsername(userName);
rememberMe = new OpenIDRememberMeDO();
rememberMe.setOpenID(openID);
rememberMe.setUserName(tenantUser);
domainName = TenantUtils.getDomainNameFromOpenId(openID);
dao = new OpenIDRememberMeDAO(IdentityTenantUtil.getRegistry(domainName, null));
if (ipaddress != null && cookie != null && !"null".equals(cookie)) {
hmac = IdentityUtil.getHMAC(ipaddress, cookie);
token = dao.getToken(rememberMe);
if (token == null || !token.equals(hmac)) {
return dto;
}
cookie = UUIDGenerator.getUUID();
hmac = IdentityUtil.getHMAC(ipaddress, cookie);
rememberMe.setToken(hmac);
dao.updateToken(rememberMe);
dto.setNewCookieValue(cookie);
dto.setAuthenticated(true);
MessageContext msgContext = MessageContext.getCurrentMessageContext();
HttpServletRequest request = (HttpServletRequest) msgContext
.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
HttpSession httpSession = request.getSession(false);
if (httpSession != null) {
httpSession.setAttribute(OPENID_LOGGEDIN_USER, userName);
}
return dto;
}
if (ipaddress != null && (cookie == null || "null".equals(cookie)) && isAutheticated) {
cookie = UUIDGenerator.getUUID();
hmac = IdentityUtil.getHMAC(ipaddress, cookie);
rememberMe.setToken(hmac);
dao.updateToken(rememberMe);
dto.setNewCookieValue(cookie);
dto.setAuthenticated(true);
MessageContext msgContext = MessageContext.getCurrentMessageContext();
HttpServletRequest request = (HttpServletRequest) msgContext