public class DefaultAccessTokenConverter extends Object implements AccessTokenConverter
AccessTokenConverter
.ATI, AUD, AUTHORITIES, CLIENT_ID, EXP, GRANT_TYPE, JTI, SCOPE
Constructor and Description |
---|
DefaultAccessTokenConverter() |
Modifier and Type | Method and Description |
---|---|
Map<String,?> |
convertAccessToken(OAuth2AccessToken token,
OAuth2Authentication authentication) |
OAuth2AccessToken |
extractAccessToken(String value,
Map<String,?> map)
Recover an access token from the converted value.
|
OAuth2Authentication |
extractAuthentication(Map<String,?> map)
Recover an
OAuth2Authentication from the converted access token. |
void |
setClientIdAttribute(String clientIdAttribute)
Set client id attribute name to be used in the converted token.
|
void |
setIncludeGrantType(boolean includeGrantType)
Flag to indicate the the grant type should be included in the converted token.
|
void |
setScopeAttribute(String scopeAttribute)
Set scope attribute name to be used in the converted token.
|
void |
setUserTokenConverter(UserAuthenticationConverter userTokenConverter)
Converter for the part of the data in the token representing a user.
|
public void setUserTokenConverter(UserAuthenticationConverter userTokenConverter)
userTokenConverter
- the userTokenConverter to setpublic void setIncludeGrantType(boolean includeGrantType)
includeGrantType
- the flag value (default false)public void setScopeAttribute(String scopeAttribute)
AccessTokenConverter.SCOPE
.scopeAttribute
- the scope attribute name to usepublic void setClientIdAttribute(String clientIdAttribute)
AccessTokenConverter.CLIENT_ID
.clientIdAttribute
- the client id attribute name to usepublic Map<String,?> convertAccessToken(OAuth2AccessToken token, OAuth2Authentication authentication)
convertAccessToken
in interface AccessTokenConverter
token
- an access tokenauthentication
- the current OAuth authenticationpublic OAuth2AccessToken extractAccessToken(String value, Map<String,?> map)
AccessTokenConverter
AccessTokenConverter.convertAccessToken(OAuth2AccessToken, OAuth2Authentication)
.extractAccessToken
in interface AccessTokenConverter
value
- the token valuemap
- information decoded from an access tokenpublic OAuth2Authentication extractAuthentication(Map<String,?> map)
AccessTokenConverter
OAuth2Authentication
from the converted access token. Half the inverse of
AccessTokenConverter.convertAccessToken(OAuth2AccessToken, OAuth2Authentication)
.extractAuthentication
in interface AccessTokenConverter
map
- information decoded from an access tokenCopyright © 2019. All rights reserved.