|
@@ -11,6 +11,7 @@ import com.nimbusds.jwt.SignedJWT;
|
|
import com.taobao.api.ApiException;
|
|
import com.taobao.api.ApiException;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.maxkey.authn.AbstractAuthenticationProvider;
|
|
import org.maxkey.authn.AbstractAuthenticationProvider;
|
|
|
|
+import org.maxkey.authn.LoginCredential;
|
|
import org.maxkey.authn.realm.jdbc.JdbcAuthenticationRealm;
|
|
import org.maxkey.authn.realm.jdbc.JdbcAuthenticationRealm;
|
|
import org.maxkey.authn.support.jwt.JwtLoginService;
|
|
import org.maxkey.authn.support.jwt.JwtLoginService;
|
|
import org.maxkey.authn.support.socialsignon.service.SocialSignOnProviderService;
|
|
import org.maxkey.authn.support.socialsignon.service.SocialSignOnProviderService;
|
|
@@ -26,6 +27,7 @@ import org.maxkey.persistence.service.OrganizationsService;
|
|
import org.maxkey.persistence.service.UserInfoService;
|
|
import org.maxkey.persistence.service.UserInfoService;
|
|
import org.maxkey.util.JsonUtils;
|
|
import org.maxkey.util.JsonUtils;
|
|
import org.maxkey.util.RetCode;
|
|
import org.maxkey.util.RetCode;
|
|
|
|
+import org.maxkey.web.WebConstants;
|
|
import org.maxkey.web.WebContext;
|
|
import org.maxkey.web.WebContext;
|
|
import org.maxkey.web.component.TreeNode;
|
|
import org.maxkey.web.component.TreeNode;
|
|
import org.maxkey.web.component.TreeNodeList;
|
|
import org.maxkey.web.component.TreeNodeList;
|
|
@@ -123,11 +125,17 @@ public class ThirdLoginController
|
|
redisConnection.setex(token, 60 * 60 * 24 * 7, JSON.toJSONString(userInfo));
|
|
redisConnection.setex(token, 60 * 60 * 24 * 7, JSON.toJSONString(userInfo));
|
|
redisConnection.close();
|
|
redisConnection.close();
|
|
_logger.debug("token >>>" + token);
|
|
_logger.debug("token >>>" + token);
|
|
- result.setData(data);
|
|
|
|
- result.setCode(RetCode.SUCCESS);
|
|
|
|
|
|
+
|
|
// 登录
|
|
// 登录
|
|
|
|
+ // 认证信息
|
|
|
|
+ LoginCredential loginCredential = new LoginCredential(
|
|
|
|
+ userInfo.getUsername(), "", ConstantsLoginType.SOCIALSIGNON);
|
|
|
|
+ authenticationProvider.authentication(loginCredential, true);
|
|
|
|
+ data.put("sessionId", request.getSession().getId());
|
|
loginHistoryService.login(userInfo, WebContext.genId(), ConstantsLoginType.JWT, "success", "", "", "", "", 1);
|
|
loginHistoryService.login(userInfo, WebContext.genId(), ConstantsLoginType.JWT, "success", "", "", "", "", 1);
|
|
|
|
|
|
|
|
+ result.setData(data);
|
|
|
|
+ result.setCode(RetCode.SUCCESS);
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|