Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.jersey.oauth.server.spi
Interface OAuthProvider

All Known Implementing Classes:
  DefaultOAuthProvider

    public interface OAuthProvider

Contract for a provider that supports managing OAuth tokens and consumer secrets. To add an `OAuthProvider` implementation, annotate the implementation class with `&#64;Provider`.

Author:
  Martin Matula

Method Summary
`OAuthToken` | `getAccessToken(java.lang.String token)` Returns the access token by the consumer key and token value.
`OAuthConsumer` | `getConsumer(java.lang.String consumerKey)` Gets consumer corresponding to a given consumer key.
`OAuthToken` | `getRequestToken(java.lang.String token)` Returns the request token by the consumer key and token value.
`OAuthToken` | `newAccessToken(OAuthToken requestToken, java.lang.String verifier)` Creates a new access token.
`OAuthToken` | `newRequestToken(java.lang.String consumerKey, java.lang.String callbackUrl, java.util.Map<java.lang.String,java.util.List<java.lang.String>> attributes)` Creates a new request token for a given consumerKey.

Method Detail

### getConsumer

    OAuthConsumer getConsumer(java.lang.String consumerKey)

  Gets consumer corresponding to a given consumer key.

  Parameters:
    `consumerKey` - consumer key
  Returns:
    corresponding consumer secret or null if no consumer with the given key is known

### newRequestToken

    OAuthToken newRequestToken(java.lang.String consumerKey,
                               java.lang.String callbackUrl,
                               java.util.Map<java.lang.String,java.util.List<java.lang.String>> attributes)

  Creates a new request token for a given consumerKey.

  Parameters:
    `consumerKey` - consumer key to create a request token for
    `callbackUrl` - callback url for this request token request
    `attributes` - additional service provider-specific parameters (this can be used to indicate what level of access is requested - i.e. readonly, or r/w, etc.)
  Returns:
    new request token

### getRequestToken

    OAuthToken getRequestToken(java.lang.String token)

  Returns the request token by the consumer key and token value.

  Parameters:
    `token` - request token value
  Returns:
    request token or null if no such token corresponding to a given consumer key is found

### newAccessToken

    OAuthToken newAccessToken(OAuthToken requestToken,
                              java.lang.String verifier)

  Creates a new access token. This method must validate the passed arguments and return null if any of them is invalid.

  Parameters:
    `requestToken` - authorized request token
    `verifier` - verifier passed to the callback after authorization
  Returns:
    new access token or null if the arguments are invalid (e.g. there is no such request token as in the argument, or the verifier does not match)

### getAccessToken

    OAuthToken getAccessToken(java.lang.String token)

  Returns the access token by the consumer key and token value.

  Parameters:
    `token` - access token value
  Returns:
    access token or null if no such found

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2013 Oracle Corporation. All Rights Reserved.