Apache CXF API

org.apache.cxf.rs.security.oauth2.provider
Interface OAuthDataProvider

All Known Subinterfaces:
AuthorizationCodeDataProvider
All Known Implementing Classes:
AbstractAuthorizationCodeDataProvider

public interface OAuthDataProvider

OAuth provider responsible for persisting the information about OAuth consumers, request and access tokens.


Method Summary
 List<OAuthPermission> convertScopeToPermissions(Client client, List<String> requestedScope)
          Converts the requested scope to the list of permissions
 ServerAccessToken createAccessToken(AccessTokenRegistration accessToken)
          Create access token
 ServerAccessToken getAccessToken(String accessToken)
          Get access token
 Client getClient(String clientId)
          Returns the previously registered third-party Client
 ServerAccessToken getPreauthorizedToken(Client client, List<String> requestedScopes, UserSubject subject, String grantType)
          Get preauthorized access token
 ServerAccessToken refreshAccessToken(Client client, String refreshToken, List<String> requestedScopes)
          Refresh access token
 void removeAccessToken(ServerAccessToken accessToken)
          Removes the access token The runtime will call this method if it finds that a token has expired
 void revokeToken(Client client, String token, String tokenTypeHint)
          Revokes a refresh or access token
 

Method Detail

getClient

Client getClient(String clientId)
                 throws OAuthServiceException
Returns the previously registered third-party Client

Parameters:
clientId - the client id
Returns:
Client
Throws:
OAuthServiceException

createAccessToken

ServerAccessToken createAccessToken(AccessTokenRegistration accessToken)
                                    throws OAuthServiceException
Create access token

Parameters:
accessToken - the token registration info
Returns:
AccessToken
Throws:
OAuthServiceException

getAccessToken

ServerAccessToken getAccessToken(String accessToken)
                                 throws OAuthServiceException
Get access token

Parameters:
accessToken - the token key
Returns:
AccessToken
Throws:
OAuthServiceException

getPreauthorizedToken

ServerAccessToken getPreauthorizedToken(Client client,
                                        List<String> requestedScopes,
                                        UserSubject subject,
                                        String grantType)
                                        throws OAuthServiceException
Get preauthorized access token

Parameters:
client - Client
requestedScopes - the scopes requested by the client
subject - End User subject
Returns:
AccessToken access token
Throws:
OAuthServiceException

refreshAccessToken

ServerAccessToken refreshAccessToken(Client client,
                                     String refreshToken,
                                     List<String> requestedScopes)
                                     throws OAuthServiceException
Refresh access token

Parameters:
client - the client
refreshToken - refresh token key
requestedScopes - the scopes requested by the client
Returns:
AccessToken
Throws:
OAuthServiceException

removeAccessToken

void removeAccessToken(ServerAccessToken accessToken)
                       throws OAuthServiceException
Removes the access token The runtime will call this method if it finds that a token has expired

Parameters:
accessToken - the token
Throws:
OAuthServiceException

revokeToken

void revokeToken(Client client,
                 String token,
                 String tokenTypeHint)
                 throws OAuthServiceException
Revokes a refresh or access token

Parameters:
token - token identifier
tokenTypeHint -
Throws:
OAuthServiceException

convertScopeToPermissions

List<OAuthPermission> convertScopeToPermissions(Client client,
                                                List<String> requestedScope)
Converts the requested scope to the list of permissions

Parameters:
requestedScope -
Returns:
list of permissions

Apache CXF API

Apache CXF