org.springframework.security.oauth2.provider.token
Class DefaultAccessTokenConverter

java.lang.Object
  extended by org.springframework.security.oauth2.provider.token.DefaultAccessTokenConverter
All Implemented Interfaces:
AccessTokenConverter

public class DefaultAccessTokenConverter
extends Object
implements AccessTokenConverter

Default implementation of AccessTokenConverter.

Author:
Dave Syer

Constructor Summary
DefaultAccessTokenConverter()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAccessTokenConverter

public DefaultAccessTokenConverter()
Method Detail

convertAccessToken

public Map<String,?> convertAccessToken(OAuth2AccessToken token,
                                        OAuth2Authentication authentication)
Specified by:
convertAccessToken in interface AccessTokenConverter
Parameters:
token - an access token
authentication - the current OAuth authentication
Returns:
a map representation of the token suitable for a JSON response

extractAccessToken

public OAuth2AccessToken extractAccessToken(String value,
                                            Map<String,?> map)
Description copied from interface: AccessTokenConverter
Recover an access token from the converted value. Half the inverse of AccessTokenConverter.convertAccessToken(OAuth2AccessToken, OAuth2Authentication).

Specified by:
extractAccessToken in interface AccessTokenConverter
Parameters:
value - the token value
map - information decoded from an access token
Returns:
an access token

extractAuthentication

public OAuth2Authentication extractAuthentication(Map<String,?> map)
Description copied from interface: AccessTokenConverter
Recover an OAuth2Authentication from the converted access token. Half the inverse of AccessTokenConverter.convertAccessToken(OAuth2AccessToken, OAuth2Authentication).

Specified by:
extractAuthentication in interface AccessTokenConverter
Parameters:
map - information decoded from an access token
Returns:
an authentication representing the client and user (if there is one)


Copyright © 2013. All rights reserved.