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 theOAuth1ServerFeatureor registered as a standard provider.- Author:
- Martin Matula
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OAuth1TokengetAccessToken(String token)Returns the access token by the consumer key and token value.OAuth1ConsumergetConsumer(String consumerKey)Gets consumer corresponding to a given consumer key.OAuth1TokengetRequestToken(String token)Returns the request token by the consumer key and token value.OAuth1TokennewAccessToken(OAuth1Token requestToken, String verifier)Creates a new access token.OAuth1TokennewRequestToken(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 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
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 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
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
-
-