org.glassfish.jersey.server.oauth1
Interface OAuth1Provider

All Known Implementing Classes:
DefaultOAuth1Provider

@Contract
public interface OAuth1Provider

Contract for a provider that supports managing OAuth tokens and consumer secrets. The provider should be either defined in the OAuth1ServerFeature or registered as a standard provider.

Author:
Martin Matula

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

Method Detail

getConsumer

OAuth1Consumer getConsumer(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

OAuth1Token newRequestToken(String consumerKey,
                            String callbackUrl,
                            Map<String,List<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

OAuth1Token getRequestToken(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

OAuth1Token newAccessToken(OAuth1Token requestToken,
                           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

OAuth1Token getAccessToken(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


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.