Class NimbusOpaqueTokenIntrospector
- java.lang.Object
-
- org.springframework.security.oauth2.server.resource.introspection.NimbusOpaqueTokenIntrospector
-
- All Implemented Interfaces:
OpaqueTokenIntrospector
public class NimbusOpaqueTokenIntrospector extends java.lang.Object implements OpaqueTokenIntrospector
A Nimbus implementation ofOpaqueTokenIntrospectorthat verifies and introspects a token using the configured OAuth 2.0 Introspection Endpoint.- Since:
- 5.2
-
-
Constructor Summary
Constructors Constructor Description NimbusOpaqueTokenIntrospector(java.lang.String introspectionUri, java.lang.String clientId, java.lang.String clientSecret)Creates aOpaqueTokenAuthenticationProviderwith the provided parametersNimbusOpaqueTokenIntrospector(java.lang.String introspectionUri, org.springframework.web.client.RestOperations restOperations)Creates aOpaqueTokenAuthenticationProviderwith the provided parameters The givenRestOperationsshould perform its own client authentication against the introspection endpoint.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipalintrospect(java.lang.String token)Introspect and verify the given token, returning its attributes.voidsetRequestEntityConverter(org.springframework.core.convert.converter.Converter<java.lang.String,org.springframework.http.RequestEntity<?>> requestEntityConverter)Sets theConverterused for converting the OAuth 2.0 access token to aRequestEntityrepresentation of the OAuth 2.0 token introspection request.
-
-
-
Constructor Detail
-
NimbusOpaqueTokenIntrospector
public NimbusOpaqueTokenIntrospector(java.lang.String introspectionUri, java.lang.String clientId, java.lang.String clientSecret)Creates aOpaqueTokenAuthenticationProviderwith the provided parameters- Parameters:
introspectionUri- The introspection endpoint uriclientId- The client id authorized to introspectclientSecret- The client's secret
-
NimbusOpaqueTokenIntrospector
public NimbusOpaqueTokenIntrospector(java.lang.String introspectionUri, org.springframework.web.client.RestOperations restOperations)Creates aOpaqueTokenAuthenticationProviderwith the provided parameters The givenRestOperationsshould perform its own client authentication against the introspection endpoint.- Parameters:
introspectionUri- The introspection endpoint urirestOperations- The client for performing the introspection request
-
-
Method Detail
-
introspect
public org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal introspect(java.lang.String token)
Description copied from interface:OpaqueTokenIntrospectorIntrospect and verify the given token, returning its attributes. Returning aMapis indicative that the token is valid.- Specified by:
introspectin interfaceOpaqueTokenIntrospector- Parameters:
token- the token to introspect- Returns:
- the token's attributes
-
setRequestEntityConverter
public void setRequestEntityConverter(org.springframework.core.convert.converter.Converter<java.lang.String,org.springframework.http.RequestEntity<?>> requestEntityConverter)
Sets theConverterused for converting the OAuth 2.0 access token to aRequestEntityrepresentation of the OAuth 2.0 token introspection request.- Parameters:
requestEntityConverter- theConverterused for converting to aRequestEntityrepresentation of the token introspection request
-
-