Commit 739d36a0 authored by fangxinjiang's avatar fangxinjiang

鉴权-fxj

parent d85f2fae
......@@ -60,7 +60,7 @@ public class WxLoginAuthenticationFilter extends AbstractAuthenticationProcessin
}
AbstractAuthenticationToken authRequest;
String code = obtainParameter(request, "code");
if (!Common.isEmpty(code)) {
if (Common.isEmpty(code)) {
throw new AuthenticationServiceException("未获取到授权码:"+code);
}
// String result = restTemplate.getForObject(String.format(SecurityConstants.WX_GET_ACCOSS_TOKEN, wxConfig.getCorpid(), wxConfig.getCorpsecret()), String.class);
......
......@@ -81,7 +81,7 @@ public class YifuWxLoginSuccessHandler implements AuthenticationSuccessHandler {
scope.add("server");
TokenRequest tokenRequest = new TokenRequest(MapUtil.newHashMap(), "auth",scope, "password");
//校验scope
ClientDetails clientDetails = clientDetailsService.loadClientByClientId(null);
ClientDetails clientDetails = clientDetailsService.loadClientByClientId("auth");
new DefaultOAuth2RequestValidator().validateScope(tokenRequest, clientDetails);
OAuth2Request oAuth2Request = tokenRequest.createOAuth2Request(clientDetails);
OAuth2Authentication oAuth2Authentication = new OAuth2Authentication(oAuth2Request, authentication);
......
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