public class BallcatRemoteOpaqueTokenIntrospector extends Object implements org.springframework.security.oauth2.server.resource.introspection.OpaqueTokenIntrospector
SpringOpaqueTokenIntrospector,重写了 OAuth2AuthenticatedPrincipal
的构建,保持项目内统一使用 User
A Spring implementation of OpaqueTokenIntrospector that verifies and
introspects a token using the configured
OAuth 2.0 Introspection
Endpoint.| 构造器和说明 |
|---|
BallcatRemoteOpaqueTokenIntrospector(String introspectionUri,
org.springframework.web.client.RestOperations restOperations)
Creates a
OpaqueTokenAuthenticationProvider with the provided parameters
The given RestOperations should perform its own client authentication
against the introspection endpoint. |
BallcatRemoteOpaqueTokenIntrospector(String introspectionUri,
String clientId,
String clientSecret)
Creates a
OpaqueTokenAuthenticationProvider with the provided parameters |
| 限定符和类型 | 方法和说明 |
|---|---|
org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal |
introspect(String token) |
void |
setRequestEntityConverter(org.springframework.core.convert.converter.Converter<String,org.springframework.http.RequestEntity<?>> requestEntityConverter)
Sets the
Converter used for converting the OAuth 2.0 access token to a
RequestEntity representation of the OAuth 2.0 token introspection request. |
public BallcatRemoteOpaqueTokenIntrospector(String introspectionUri, String clientId, String clientSecret)
OpaqueTokenAuthenticationProvider with the provided parametersintrospectionUri - The introspection endpoint uriclientId - The client id authorized to introspectclientSecret - The client's secretpublic BallcatRemoteOpaqueTokenIntrospector(String introspectionUri, org.springframework.web.client.RestOperations restOperations)
OpaqueTokenAuthenticationProvider with the provided parameters
The given RestOperations should perform its own client authentication
against the introspection endpoint.
introspectionUri - The introspection endpoint urirestOperations - The client for performing the introspection requestpublic org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal introspect(String token)
introspect 在接口中 org.springframework.security.oauth2.server.resource.introspection.OpaqueTokenIntrospectorpublic void setRequestEntityConverter(org.springframework.core.convert.converter.Converter<String,org.springframework.http.RequestEntity<?>> requestEntityConverter)
Converter used for converting the OAuth 2.0 access token to a
RequestEntity representation of the OAuth 2.0 token introspection request.requestEntityConverter - the Converter used for converting to a
RequestEntity representation of the token introspection requestCopyright © 2023. All rights reserved.