|
@@ -19,6 +19,7 @@
|
|
|
package org.hswebframework.web.authorization.oauth2.controller;
|
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.hswebframework.web.authorization.Authentication;
|
|
|
import org.hswebframework.web.authorization.annotation.Authorize;
|
|
@@ -31,6 +32,7 @@ import org.hswebframework.web.authorization.oauth2.server.support.code.HttpAutho
|
|
|
import org.hswebframework.web.authorization.oauth2.server.support.implicit.HttpImplicitRequest;
|
|
|
import org.hswebframework.web.authorization.oauth2.server.support.implicit.ImplicitRequest;
|
|
|
import org.hswebframework.web.oauth2.core.GrantType;
|
|
|
+import org.hswebframework.web.oauth2.core.OAuth2Constants;
|
|
|
import org.hswebframework.web.oauth2.model.AuthorizationCodeModel;
|
|
|
import org.hswebframework.web.oauth2.model.ImplicitAccessTokenModel;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -55,6 +57,7 @@ public class OAuth2AuthorizeController {
|
|
|
@GetMapping(params = "response_type=code")
|
|
|
@ApiOperation("获取当前登录用户OAuth2.0授权码")
|
|
|
@Authorize
|
|
|
+ @ApiImplicitParam(paramType = "query",name = OAuth2Constants.client_id,required = true)
|
|
|
public AuthorizationCodeModel requestCode(
|
|
|
@RequestParam("redirect_uri") String redirectUri,
|
|
|
@RequestParam(value = "state", required = false) String state,
|
|
@@ -74,7 +77,8 @@ public class OAuth2AuthorizeController {
|
|
|
|
|
|
|
|
|
@GetMapping(params = "response_type=token")
|
|
|
- @ApiOperation(value = "implicit方式授权",tags = "OAuth2.0-申请token")
|
|
|
+ @ApiOperation(value = "implicit方式授权", tags = "OAuth2.0-申请token")
|
|
|
+ @ApiImplicitParam(paramType = "query",name = OAuth2Constants.client_id,required = true)
|
|
|
public ImplicitAccessTokenModel authorizeByImplicit(
|
|
|
@RequestParam(value = "redirect_uri") String redirect_uri,
|
|
|
@RequestParam(value = "state") String state,
|