public class TokenValidatingUserInfoTokenServices
extends org.springframework.security.oauth2.provider.token.DefaultTokenServices
DefaultTokenServices that provides the functionality of the RemoteTokenServices
to validate a passed Access Token from a remote OAuth Server (introspection).| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger |
| Constructor and Description |
|---|
TokenValidatingUserInfoTokenServices(String userInfoEndpointUrl,
String tokenInfoUri,
String clientId,
String clientSecret)
Initialize the DataFlowUserInfoTokenServices.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
getAuthorizationHeader(String clientId,
String clientSecret)
Copied from
RemoteTokenServices. |
protected Object |
getPrincipal(Map<String,Object> map)
Return the principal that should be used for the token.
|
org.springframework.security.oauth2.provider.OAuth2Authentication |
loadAuthentication(String accessTokenValue) |
protected Map<String,Object> |
postForMap(String path,
org.springframework.util.MultiValueMap<String,String> formData,
org.springframework.http.HttpHeaders headers)
Copied from
RemoteTokenServices. |
org.springframework.security.oauth2.common.OAuth2AccessToken |
readAccessToken(String accessToken) |
protected org.springframework.security.oauth2.common.OAuth2AccessToken |
retrieveAccessTokenFromOAuthServer(String accessToken)
This method will take a received accessToken and call the introspection endpoint of the
OAuth provider to validate the token and retrieved the associated scopes associated with the token.
|
void |
setAuthoritiesExtractor(org.springframework.boot.autoconfigure.security.oauth2.resource.AuthoritiesExtractor authoritiesExtractor) |
void |
setClientDetailsService(org.springframework.security.oauth2.provider.ClientDetailsService clientDetailsService)
The client details service to use for looking up clients (if necessary).
|
void |
setPrincipalExtractor(org.springframework.boot.autoconfigure.security.oauth2.resource.PrincipalExtractor principalExtractor) |
void |
setRestTemplate(org.springframework.security.oauth2.client.OAuth2RestOperations restTemplate) |
void |
setTokenName(String tokenName)
See also
RemoteTokenServices. |
void |
setTokenStore(org.springframework.security.oauth2.provider.token.TokenStore tokenStore)
The persistence strategy for token storage.
|
afterPropertiesSet, createAccessToken, getAccessToken, getAccessTokenValiditySeconds, getClientId, getRefreshTokenValiditySeconds, isExpired, isSupportRefreshToken, refreshAccessToken, revokeToken, setAccessTokenValiditySeconds, setAuthenticationManager, setRefreshTokenValiditySeconds, setReuseRefreshToken, setSupportRefreshToken, setTokenEnhancerpublic TokenValidatingUserInfoTokenServices(String userInfoEndpointUrl, String tokenInfoUri, String clientId, String clientSecret)
userInfoEndpointUrl - Must not be emptytokenInfoUri - Must not be emptyclientId - Must not be emptyclientSecret - Must not be emptypublic void setRestTemplate(org.springframework.security.oauth2.client.OAuth2RestOperations restTemplate)
public void setAuthoritiesExtractor(org.springframework.boot.autoconfigure.security.oauth2.resource.AuthoritiesExtractor authoritiesExtractor)
public void setPrincipalExtractor(org.springframework.boot.autoconfigure.security.oauth2.resource.PrincipalExtractor principalExtractor)
public org.springframework.security.oauth2.provider.OAuth2Authentication loadAuthentication(String accessTokenValue) throws org.springframework.security.core.AuthenticationException, org.springframework.security.oauth2.common.exceptions.InvalidTokenException
loadAuthentication in interface org.springframework.security.oauth2.provider.token.ResourceServerTokenServicesloadAuthentication in class org.springframework.security.oauth2.provider.token.DefaultTokenServicesorg.springframework.security.core.AuthenticationExceptionorg.springframework.security.oauth2.common.exceptions.InvalidTokenExceptionprotected Object getPrincipal(Map<String,Object> map)
PrincipalExtractor.map - the source mappublic org.springframework.security.oauth2.common.OAuth2AccessToken readAccessToken(String accessToken)
readAccessToken in interface org.springframework.security.oauth2.provider.token.ResourceServerTokenServicesreadAccessToken in class org.springframework.security.oauth2.provider.token.DefaultTokenServicesprotected org.springframework.security.oauth2.common.OAuth2AccessToken retrieveAccessTokenFromOAuthServer(String accessToken)
accessToken - protected String getAuthorizationHeader(String clientId, String clientSecret)
RemoteTokenServices.clientId - clientSecret - protected Map<String,Object> postForMap(String path, org.springframework.util.MultiValueMap<String,String> formData, org.springframework.http.HttpHeaders headers)
RemoteTokenServices.path - formData - headers - public void setTokenStore(org.springframework.security.oauth2.provider.token.TokenStore tokenStore)
setTokenStore in class org.springframework.security.oauth2.provider.token.DefaultTokenServicestokenStore - the store for access and refresh tokens.public void setClientDetailsService(org.springframework.security.oauth2.provider.ClientDetailsService clientDetailsService)
DefaultTokenServices.setAccessTokenValiditySeconds(int).setClientDetailsService in class org.springframework.security.oauth2.provider.token.DefaultTokenServicesclientDetailsService - the client details servicepublic void setTokenName(String tokenName)
RemoteTokenServices. Property name to set on a post request to
introspect an OAuth Token. Defaults to token.
For UAA see: https://docs.cloudfoundry.org/api/uaa/version/4.26.0/index.html#introspect-tokenCopyright © 2019 Pivotal Software, Inc.. All rights reserved.