Apache CXF API

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

All Known Subinterfaces:
AuthorizationCodeDataProvider

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, UserSubject subject, String grantType)
          Get preauthorized access token
 ServerAccessToken refreshAccessToken(String clientId, String refreshToken)
          Refresh access token
 void removeAccessToken(ServerAccessToken accessToken)
          Removes the 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,
                                        UserSubject subject,
                                        String grantType)
                                        throws OAuthServiceException
Get preauthorized access token

Parameters:
client - Client
subject - End User subject
Returns:
AccessToken access token
Throws:
OAuthServiceException

refreshAccessToken

ServerAccessToken refreshAccessToken(String clientId,
                                     String refreshToken)
                                     throws OAuthServiceException
Refresh access token

Parameters:
clientId - the client id
refreshToken - refresh token key
Returns:
AccessToken
Throws:
OAuthServiceException

removeAccessToken

void removeAccessToken(ServerAccessToken accessToken)
                       throws OAuthServiceException
Removes the token

Parameters:
accessToken - the token
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