diff --git a/src/main/java/com/dl/officialsite/oauth2/controller/OAuthProcessController.java b/src/main/java/com/dl/officialsite/oauth2/controller/OAuthProcessController.java index 8bc764c1..5f24cb4a 100644 --- a/src/main/java/com/dl/officialsite/oauth2/controller/OAuthProcessController.java +++ b/src/main/java/com/dl/officialsite/oauth2/controller/OAuthProcessController.java @@ -163,25 +163,27 @@ public BaseResponse receiveAuthorizationCode( throw new RuntimeException("Failed to get access token id "); } String accessToken = accessTokenResponse.getAccessToken(); - log.info("access token received"); + log.info("access token received: {}", accessToken); + return BaseResponse.successWithData(accessToken); /** * 3. Get user info via access_token */ - IUserInfoRetrieveHandler retrieveHandler = this.userInfoRetrieveHandlers.get(registrationId); - Assert.notNull(retrieveHandler, "retrieveHandler not found:"+registrationId); - IUserInfo userInfo = retrieveHandler.retrieve(registration.getUserInfoUri(), accessToken); - log.info("user info {}", userInfo.getUsername()); - Assert.notNull(userInfo, "failed to find userInfo"); +// IUserInfoRetrieveHandler retrieveHandler = this.userInfoRetrieveHandlers.get(registrationId); +// Assert.notNull(retrieveHandler, "retrieveHandler not found:"+registrationId); +// IUserInfo userInfo = retrieveHandler.retrieve(registration.getUserInfoUri(), accessToken); +// log.info("user info {}", userInfo.getUsername()); +// Assert.notNull(userInfo, "failed to find userInfo"); /** * 4. Bind userInfo */ - IOAuthBindHandler bindHandler = this.bindHandlers.get(registrationId); - Assert.notNull(bindHandler, "bindHandler not found:"+registrationId); - bindHandler.bind(UserSecurityUtils.getUserLogin().getAddress(), userInfo); - - response.addCookie(new Cookie("oauth_"+registrationId, userInfo.getUsername())); - return BaseResponse.successWithData(userInfo.getUsername()); +// IOAuthBindHandler bindHandler = this.bindHandlers.get(registrationId); +// Assert.notNull(bindHandler, "bindHandler not found:"+registrationId); +// +// bindHandler.bind(UserSecurityUtils.getUserLogin().getAddress(), userInfo); +// +// response.addCookie(new Cookie("oauth_"+registrationId, userInfo.getUsername())); +// return BaseResponse.successWithData(userInfo.getUsername()); } @GetMapping("username/{registrationId}") diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 99712588..0212721b 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -67,8 +67,6 @@ oauth: clientId: "${TWITTER_CLIENT_KEY}" clientSecret: "${TWITTER_CLIENT_SECRET}" - - qcloud: #初始化用户身份信息 前往控制台密钥管理查看 secretId: ${SECRET_ID}