This commit is contained in:
MaxKey
2021-12-14 12:38:06 +08:00
parent c490551aef
commit de702ada8e
53 changed files with 302 additions and 344 deletions

View File

@@ -66,8 +66,8 @@ import org.springframework.web.servlet.view.RedirectView;
import org.springframework.web.util.UriComponents;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.web.util.UriTemplate;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
/**
* <p>
@@ -86,7 +86,7 @@ import io.swagger.annotations.ApiOperation;
* @author Vladimir Kryachko
*
*/
@Api(tags = "2-1-OAuth v2.0 API文档模块")
@Tag(name = "2-1-OAuth v2.0 API文档模块")
@Controller
@SessionAttributes("authorizationRequest")
public class AuthorizationEndpoint extends AbstractEndpoint {
@@ -111,7 +111,7 @@ public class AuthorizationEndpoint extends AbstractEndpoint {
this.errorPage = errorPage;
}
@ApiOperation(value = "OAuth 2.0 认证接口", notes = "传递参数应用ID自动完成跳转认证拼接",httpMethod="GET")
@Operation(summary = "OAuth 2.0 认证接口", description = "传递参数应用ID自动完成跳转认证拼接",method="GET")
@RequestMapping(OAuth2Constants.ENDPOINT.ENDPOINT_BASE + "/{id}")
public ModelAndView authorize(
HttpServletRequest request,
@@ -135,7 +135,7 @@ public class AuthorizationEndpoint extends AbstractEndpoint {
return WebContext.redirect(authorizationUrl);
}
@ApiOperation(value = "OAuth 2.0 认证接口", notes = "传递参数client_id,response_type,redirect_uri等",httpMethod="GET")
@Operation(summary = "OAuth 2.0 认证接口", description = "传递参数client_id,response_type,redirect_uri等",method="GET")
@RequestMapping(value = {
OAuth2Constants.ENDPOINT.ENDPOINT_AUTHORIZE,
OAuth2Constants.ENDPOINT.ENDPOINT_TENCENT_IOA_AUTHORIZE

View File

@@ -45,8 +45,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
/**
* Controller which decodes access tokens for clients who are not able to do so (or where opaque token values are used).
@@ -54,7 +54,7 @@ import io.swagger.annotations.ApiOperation;
* @author Luke Taylor
* @author Joel D'sa
*/
@Api(tags = "2-1-OAuth v2.0 API文档模块")
@Tag(name = "2-1-OAuth v2.0 API文档模块")
@Controller
public class CheckTokenEndpoint {
@@ -78,7 +78,7 @@ public class CheckTokenEndpoint {
this.accessTokenConverter = accessTokenConverter;
}
@ApiOperation(value = "OAuth 2.0 token检查接口", notes = "传递参数token",httpMethod="POST")
@Operation(summary = "OAuth 2.0 token检查接口", description = "传递参数token",method="POST")
@RequestMapping(value = OAuth2Constants.ENDPOINT.ENDPOINT_CHECK_TOKEN)
@ResponseBody
public Map<String, ?> checkToken(@RequestParam(OAuth2Constants.PARAMETER.TOKEN) String value) {

View File

@@ -53,8 +53,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
/**
* <p>
@@ -73,7 +73,7 @@ import io.swagger.annotations.ApiOperation;
* @author Dave Syer
*
*/
@Api(tags = "2-1-OAuth v2.0 API文档模块")
@Tag(name = "2-1-OAuth v2.0 API文档模块")
@Controller
public class TokenEndpoint extends AbstractEndpoint {
@@ -89,7 +89,7 @@ public class TokenEndpoint extends AbstractEndpoint {
* @return OAuth2AccessToken Entity
* @throws HttpRequestMethodNotSupportedException
*/
@ApiOperation(value = "OAuth 2.0 获取AccessToken接口", notes = "传递参数token等",httpMethod="GET")
@Operation(summary = "OAuth 2.0 获取AccessToken接口", description = "传递参数token等",method="GET")
@RequestMapping(value = {
OAuth2Constants.ENDPOINT.ENDPOINT_TOKEN,
OAuth2Constants.ENDPOINT.ENDPOINT_TENCENT_IOA_TOKEN
@@ -103,7 +103,7 @@ public class TokenEndpoint extends AbstractEndpoint {
return postAccessToken(parameters);
}
@ApiOperation(value = "OAuth 2.0 获取AccessToken接口", notes = "传递参数token等",httpMethod="POST")
@Operation(summary = "OAuth 2.0 获取AccessToken接口", description = "传递参数token等",method="POST")
@RequestMapping(value = {
OAuth2Constants.ENDPOINT.ENDPOINT_TOKEN,
OAuth2Constants.ENDPOINT.ENDPOINT_TENCENT_IOA_TOKEN

View File

@@ -51,6 +51,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.nimbusds.jose.EncryptionMethod;
import com.nimbusds.jose.JWEAlgorithm;
@@ -61,11 +62,12 @@ import com.nimbusds.jwt.EncryptedJWT;
import com.nimbusds.jwt.JWT;
import com.nimbusds.jwt.JWTClaimsSet;
import com.nimbusds.jwt.JWTClaimsSet.Builder;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.nimbusds.jwt.SignedJWT;
@Api(tags = "2-1-OAuth v2.0 API文档模块")
@Tag(name = "2-1-OAuth v2.0 API文档模块")
@Controller
public class OpenIdConnectUserInfoEndpoint {
final static Logger _logger = LoggerFactory.getLogger(OpenIdConnectUserInfoEndpoint.class);
@@ -107,8 +109,8 @@ public class OpenIdConnectUserInfoEndpoint {
@Autowired
protected HttpResponseAdapter httpResponseAdapter;
@ApiOperation(value = "OIDC 用户信息接口", notes = "传递Authorization参数access_token",httpMethod="GET")
@RequestMapping(value=OAuth2Constants.ENDPOINT.ENDPOINT_OPENID_CONNECT_USERINFO)
@Operation(summary = "OIDC 用户信息接口", description = "传递Authorization参数access_token",method="GET")
@RequestMapping(value=OAuth2Constants.ENDPOINT.ENDPOINT_OPENID_CONNECT_USERINFO, method={RequestMethod.POST, RequestMethod.GET})
@ResponseBody
public String connect10aUserInfo(
@RequestHeader(value = "Authorization", required = true) String access_token,

View File

@@ -49,11 +49,12 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@Api(tags = "2-1-OAuth v2.0 API文档模块")
@Tag(name = "2-1-OAuth v2.0 API文档模块")
@Controller
public class UserInfoEndpoint {
final static Logger _logger = LoggerFactory.getLogger(UserInfoEndpoint.class);
@@ -95,8 +96,8 @@ public class UserInfoEndpoint {
@Autowired
protected HttpResponseAdapter httpResponseAdapter;
@ApiOperation(value = "OAuth 2.0 用户信息接口", notes = "传递参数access_token",httpMethod="GET")
@RequestMapping(value=OAuth2Constants.ENDPOINT.ENDPOINT_USERINFO)
@Operation(summary = "OAuth 2.0 用户信息接口", description = "传递参数access_token",method="GET")
@RequestMapping(value=OAuth2Constants.ENDPOINT.ENDPOINT_USERINFO, method={RequestMethod.POST, RequestMethod.GET})
public void apiV20UserInfo(
@RequestParam(value = "access_token", required = false) String access_token,
@RequestHeader(value = "authorization", required = false) String authorization_bearer,