| | |
| | | accessTokenDO = oauth2GrantService.grantPassword(username, password, client.getClientId(), scopes); |
| | | break; |
| | | case CLIENT_CREDENTIALS: |
| | | accessTokenDO = oauth2GrantService.grantClientCredentials(client.getClientId(), scopes); |
| | | accessTokenDO = oauth2GrantService.grantClientCredentials(username, client.getClientId(), scopes); |
| | | break; |
| | | case REFRESH_TOKEN: |
| | | accessTokenDO = oauth2GrantService.grantRefreshToken(refreshToken, client.getClientId()); |
| | |
| | | * 对应 Spring Security OAuth 的 AuthorizationEndpoint 类的 authorize 方法 |
| | | */ |
| | | @GetMapping("/authorize") |
| | | @PermitAll |
| | | @Operation(summary = "获得授权信息", description = "适合 code 授权码模式,或者 implicit 简化模式;在 sso.vue 单点登录界面被【获取】调用") |
| | | @Parameter(name = "clientId", required = true, description = "客户端编号", example = "tudou") |
| | | public CommonResult<OAuth2OpenAuthorizeInfoRespVO> authorize(@RequestParam("clientId") String clientId) { |
| | |
| | | @Parameter(name = "auto_approve", required = true, description = "用户是否接受", example = "true"), |
| | | @Parameter(name = "state", example = "1") |
| | | }) |
| | | @PermitAll |
| | | public CommonResult<String> approveOrDeny(@RequestParam("response_type") String responseType, |
| | | @RequestParam("client_id") String clientId, |
| | | @RequestParam(value = "scope", required = false) String scope, |