diff --git a/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Filter.java b/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Filter.java index bc8e068e..7cf3d6be 100644 --- a/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Filter.java +++ b/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Filter.java @@ -206,13 +206,14 @@ public class Oauth2Filter extends AuthenticatingFilter { Integer expiresOffset = 60 * 5; expiresIn = expiresIn < expiresOffset ? expiresIn / 2 : expiresIn -expiresOffset; token.expiresIn = DateUtil.offset(new Date(), DateField.SECOND, expiresIn); + sdtToken = token; } } } } UrlBuilder urlBuilder = UrlBuilder.ofHttp(requestUri, CharsetUtil.CHARSET_UTF_8); CharSequence code = urlBuilder.getQuery().get("code"); - String userInfoUrl = String.format("%s/cgi-bin/user/getuserinfo?access_token=&s&code=%s", + String userInfoUrl = String.format("%s/cgi-bin/user/getuserinfo?access_token=%s&code=%s", apiUrl, sdtToken.accessToken, code); @@ -240,8 +241,8 @@ public class Oauth2Filter extends AuthenticatingFilter { cookie.setPath("/"); response.addCookie(cookie); response.addHeader(Constant.TOKEN_HEADER, currentToken); - //去掉凭证参数 - String removeCreditParame = ssoValidator.removeCreditParame(requestUri); + //回调不涉及其他页面回调,先写死回调首页 + String removeCreditParame = "http://" + urlBuilder.getHost() + ":" + urlBuilder.getPort() + "/#/home"; response.addHeader("REDIRECT", removeCreditParame); request.setAttribute(Constant.TOKEN_HEADER, currentToken); return executeLogin(request, response); diff --git a/renren-admin/src/main/resources/application.yml b/renren-admin/src/main/resources/application.yml index fd3cb7c3..aae389fa 100644 --- a/renren-admin/src/main/resources/application.yml +++ b/renren-admin/src/main/resources/application.yml @@ -165,5 +165,5 @@ shangdongtong: corpid: wwafa1a3005a15a672 agentId: 1001129 secret: fCcaNBVkCosL_O3cnQVQ0brqUUBZu3ruXuISj5k8FP8 - url: http://59.206.205.195:80 + url: http://15.72.183.90:7008/sdt