Apache CXF API

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


public interface OAuthDataProvider

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


Method Summary
 AccessToken createAccessToken(AccessTokenRegistration reg)
          Creates a new AccessToken
 RequestToken createRequestToken(RequestTokenRegistration reg)
          Creates a temporarily request token which will capture the information about the Client attempting to access or modify the resource owner's resource
 String finalizeAuthorization(AuthorizationInput data)
          Sets the verifier confirming the resource owner's agreement for the Client to perform the action as represented by the provided RequestToken.
 AccessToken getAccessToken(String accessToken)
          Returns the AccessToken
 Client getClient(String clientId)
          Returns the previously registered third-party Client
 RequestToken getRequestToken(String requestToken)
          Returns the previously registered RequestToken
 void removeToken(Token token)
          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

createRequestToken

RequestToken createRequestToken(RequestTokenRegistration reg)
                                throws OAuthServiceException
Creates a temporarily request token which will capture the information about the Client attempting to access or modify the resource owner's resource

Parameters:
reg - RequestTokenRegistration
Returns:
new request token
Throws:
OAuthServiceException
See Also:
RequestTokenRegistration

getRequestToken

RequestToken getRequestToken(String requestToken)
                             throws OAuthServiceException
Returns the previously registered RequestToken

Parameters:
requestToken - the token key
Returns:
RequestToken
Throws:
OAuthServiceException

finalizeAuthorization

String finalizeAuthorization(AuthorizationInput data)
                             throws OAuthServiceException
Sets the verifier confirming the resource owner's agreement for the Client to perform the action as represented by the provided RequestToken. The runtime will report this verifier to the client who will exchange it for a new AccessToken

Parameters:
data - AuthorizationInput
Returns:
the generated verifier
Throws:
OAuthServiceException

createAccessToken

AccessToken createAccessToken(AccessTokenRegistration reg)
                              throws OAuthServiceException
Creates a new AccessToken

Parameters:
reg - AccessTokenRegistration instance which captures a request token approved by the resource owner
Returns:
new AccessToken
Throws:
OAuthServiceException

getAccessToken

AccessToken getAccessToken(String accessToken)
                           throws OAuthServiceException
Returns the AccessToken

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

removeToken

void removeToken(Token token)
                 throws OAuthServiceException
Removes the token

Parameters:
token - the token
Throws:
OAuthServiceException

Apache CXF API

Apache CXF