Commit 769b4aa0 authored by 周健威's avatar 周健威

添加数据中心验证代码

parent 53a367a5
......@@ -72,9 +72,7 @@ public class AuthController {
if (requestType == null || requestType.trim().equals("")) {
requestType = RequestTypeConstants.BASE;
}
final String token;
String name = "";
String token = null;
OAuthService service = (OAuthService)request.getSession().getAttribute("oauthv20service");
if(service==null){
......@@ -90,14 +88,15 @@ public class AuthController {
Token EMPTY_TOKEN = null;
Verifier verifier = new Verifier(request.getParameter("code"));
Token accessTokeToken = service.getAccessToken(EMPTY_TOKEN, verifier);
OAuthClient restClient=new OAuthClient("https://gdxm.upyuns.com/sign/api/oauth/v20/me");
UserInfo userInfo=restClient.getUserInfo(accessTokeToken.getAccess_token());
JwtAuthenticationRequest authenticationRequest = new JwtAuthenticationRequest(userInfo.getUsername(), null, JwtAuthenticationRequest.CHECKPASS_NO);
if (RequestTypeConstants.APP.equals(requestType)) {
token = appAuthService.login(authenticationRequest);
} else {
token = authService.login(authenticationRequest);
if(accessTokeToken.getAccess_token() != null) {
OAuthClient restClient=new OAuthClient("https://gdxm.upyuns.com/sign/api/oauth/v20/me");
UserInfo userInfo=restClient.getUserInfo(accessTokeToken.getAccess_token());
JwtAuthenticationRequest authenticationRequest = new JwtAuthenticationRequest(userInfo.getUsername(), null, JwtAuthenticationRequest.CHECKPASS_NO);
if (RequestTypeConstants.APP.equals(requestType)) {
token = appAuthService.login(authenticationRequest);
} else {
token = authService.login(authenticationRequest);
}
}
return new ObjectRestResponse<String>().data(token);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment