public class UserInfoTokenServices
extends java.lang.Object
implements org.springframework.security.oauth2.provider.token.ResourceServerTokenServices
ResourceServerTokenServices
that uses a user info REST service.Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger |
Constructor and Description |
---|
UserInfoTokenServices(java.lang.String userInfoEndpointUrl,
java.lang.String clientId) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
getPrincipal(java.util.Map<java.lang.String,java.lang.Object> map)
Return the principal that should be used for the token.
|
org.springframework.security.oauth2.provider.OAuth2Authentication |
loadAuthentication(java.lang.String accessToken) |
org.springframework.security.oauth2.common.OAuth2AccessToken |
readAccessToken(java.lang.String accessToken) |
void |
setAuthoritiesExtractor(AuthoritiesExtractor authoritiesExtractor) |
void |
setPrincipalExtractor(PrincipalExtractor principalExtractor) |
void |
setRestTemplate(org.springframework.security.oauth2.client.OAuth2RestOperations restTemplate) |
void |
setTokenType(java.lang.String tokenType) |
public UserInfoTokenServices(java.lang.String userInfoEndpointUrl, java.lang.String clientId)
public void setTokenType(java.lang.String tokenType)
public void setRestTemplate(org.springframework.security.oauth2.client.OAuth2RestOperations restTemplate)
public void setAuthoritiesExtractor(AuthoritiesExtractor authoritiesExtractor)
public void setPrincipalExtractor(PrincipalExtractor principalExtractor)
public org.springframework.security.oauth2.provider.OAuth2Authentication loadAuthentication(java.lang.String accessToken) throws org.springframework.security.core.AuthenticationException, org.springframework.security.oauth2.common.exceptions.InvalidTokenException
loadAuthentication
in interface org.springframework.security.oauth2.provider.token.ResourceServerTokenServices
org.springframework.security.core.AuthenticationException
org.springframework.security.oauth2.common.exceptions.InvalidTokenException
protected java.lang.Object getPrincipal(java.util.Map<java.lang.String,java.lang.Object> map)
PrincipalExtractor
.map
- the source mappublic org.springframework.security.oauth2.common.OAuth2AccessToken readAccessToken(java.lang.String accessToken)
readAccessToken
in interface org.springframework.security.oauth2.provider.token.ResourceServerTokenServices