org.springframework.security.oauth2.provider.token
Interface AccessTokenConverter

All Known Implementing Classes:
DefaultAccessTokenConverter

public interface AccessTokenConverter

Converter interface for token service implementations that store authentication data inside the token.

Author:
Dave Syer

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.
 

Method Detail

convertAccessToken

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

extractAccessToken

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

Parameters:
value - the token value
map - information decoded from an access token
Returns:
an access token

extractAuthentication

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

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.