mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 12:18:42 +08:00 
			
		
		
		
	完善 oauth2.0 的注释
This commit is contained in:
		@@ -106,7 +106,7 @@ public class OAuth2OpenController {
 | 
			
		||||
                                                                     @RequestParam(value = "scope", required = false) String scope, // 密码模式
 | 
			
		||||
                                                                     @RequestParam(value = "refresh_token", required = false) String refreshToken) { // 刷新模式
 | 
			
		||||
        List<String> scopes = OAuth2Utils.buildScopes(scope);
 | 
			
		||||
        // 授权类型
 | 
			
		||||
        // 1.1 校验授权类型
 | 
			
		||||
        OAuth2GrantTypeEnum grantTypeEnum = OAuth2GrantTypeEnum.getByGranType(grantType);
 | 
			
		||||
        if (grantTypeEnum == null) {
 | 
			
		||||
            throw exception0(BAD_REQUEST.getCode(), StrUtil.format("未知授权类型({})", grantType));
 | 
			
		||||
@@ -115,12 +115,12 @@ public class OAuth2OpenController {
 | 
			
		||||
            throw exception0(BAD_REQUEST.getCode(), "Token 接口不支持 implicit 授权模式");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 校验客户端
 | 
			
		||||
        // 1.2 校验客户端
 | 
			
		||||
        String[] clientIdAndSecret = obtainBasicAuthorization(request);
 | 
			
		||||
        OAuth2ClientDO client = oauth2ClientService.validOAuthClientFromCache(clientIdAndSecret[0], clientIdAndSecret[1],
 | 
			
		||||
                grantType, scopes, redirectUri);
 | 
			
		||||
 | 
			
		||||
        // 根据授权模式,获取访问令牌
 | 
			
		||||
        // 2. 根据授权模式,获取访问令牌
 | 
			
		||||
        OAuth2AccessTokenDO accessTokenDO;
 | 
			
		||||
        switch (grantTypeEnum) {
 | 
			
		||||
            case AUTHORIZATION_CODE:
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,7 @@ import java.util.List;
 | 
			
		||||
 * 将自身的 AdminUser 用户,授权给第三方应用,采用 OAuth2.0 的协议。
 | 
			
		||||
 *
 | 
			
		||||
 * 问题:为什么自身也作为一个第三方应用,也走这套流程呢?
 | 
			
		||||
 * 回复:当然可以这么做,采用 Implicit 模式。考虑到大多数开发者使用不到这个特性,OAuth2.0 毕竟有一定学习成本,所以暂时没有采取这种方式。
 | 
			
		||||
 * 回复:当然可以这么做,采用 password 模式。考虑到大多数开发者使用不到这个特性,OAuth2.0 毕竟有一定学习成本,所以暂时没有采取这种方式。
 | 
			
		||||
 *
 | 
			
		||||
 * @author 芋道源码
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user