Commit df924c09 authored by fangxinjiang's avatar fangxinjiang

鉴权-fxj

parent 8204ccf6
...@@ -33,6 +33,8 @@ import javax.servlet.http.HttpServletRequest; ...@@ -33,6 +33,8 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map; import java.util.Map;
/** /**
...@@ -75,7 +77,9 @@ public class YifuWxLoginSuccessHandler implements AuthenticationSuccessHandler { ...@@ -75,7 +77,9 @@ public class YifuWxLoginSuccessHandler implements AuthenticationSuccessHandler {
throw new InvalidClientException("请求头中client信息验证异常"); throw new InvalidClientException("请求头中client信息验证异常");
}*/ }*/
//TokenRequest tokenRequest = new TokenRequest(MapUtil.newHashMap(), clientId, clientDetails.getScope(), "password"); //TokenRequest tokenRequest = new TokenRequest(MapUtil.newHashMap(), clientId, clientDetails.getScope(), "password");
TokenRequest tokenRequest = new TokenRequest(MapUtil.newHashMap(), null,null, "password"); Collection<String> scope = new ArrayList<>();
scope.add("server");
TokenRequest tokenRequest = new TokenRequest(MapUtil.newHashMap(), "auth",scope, "password");
//校验scope //校验scope
ClientDetails clientDetails = clientDetailsService.loadClientByClientId(null); ClientDetails clientDetails = clientDetailsService.loadClientByClientId(null);
new DefaultOAuth2RequestValidator().validateScope(tokenRequest, clientDetails); new DefaultOAuth2RequestValidator().validateScope(tokenRequest, clientDetails);
......
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