Interface OAuth1Provider
- All Known Implementing Classes:
DefaultOAuth1Provider
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.-
Method Summary
Modifier and TypeMethodDescriptiongetAccessToken
(String token) Returns the access token by the consumer key and token value.getConsumer
(String consumerKey) Gets consumer corresponding to a given consumer key.getRequestToken
(String token) Returns the request token by the consumer key and token value.newAccessToken
(OAuth1Token requestToken, String verifier) Creates a new access token.Creates a new request token for a given consumerKey.
-
Method Details
-
getConsumer
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 forcallbackUrl
- callback url for this request token requestattributes
- 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
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
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 tokenverifier
- 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
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
-