public interface OAuthConsumerSupport
Modifier and Type | Method and Description |
---|---|
URL |
configureURLForProtectedAccess(URL url,
OAuthConsumerToken accessToken,
String httpMethod,
Map<String,String> additionalParameters)
Create a configured URL.
|
OAuthConsumerToken |
getAccessToken(OAuthConsumerToken requestToken,
String verifier)
Get an access token for a protected resource.
|
OAuthConsumerToken |
getAccessToken(ProtectedResourceDetails resource,
OAuthConsumerToken requestToken,
String verifier)
Get an access token for a protected resource.
|
String |
getAuthorizationHeader(ProtectedResourceDetails details,
OAuthConsumerToken accessToken,
URL url,
String httpMethod,
Map<String,String> additionalParameters)
Get the authorization header using the given access token that should be applied to the specified URL.
|
String |
getOAuthQueryString(ProtectedResourceDetails details,
OAuthConsumerToken accessToken,
URL url,
String httpMethod,
Map<String,String> additionalParameters)
Get the query string that is to be used in the given request.
|
OAuthConsumerToken |
getUnauthorizedRequestToken(ProtectedResourceDetails resource,
String callback)
Get an unauthorized request token for a protected resource.
|
OAuthConsumerToken |
getUnauthorizedRequestToken(String resourceId,
String callback)
Get an unauthorized request token for a protected resource.
|
InputStream |
readProtectedResource(URL url,
OAuthConsumerToken accessToken,
String httpMethod)
Read a protected resource from the given URL using the specified access token and HTTP method.
|
OAuthConsumerToken getUnauthorizedRequestToken(String resourceId, String callback) throws OAuthRequestFailedException
resourceId
- The id of the protected resource for which to get a consumer token.callback
- The callback URL.OAuthRequestFailedException
OAuthConsumerToken getUnauthorizedRequestToken(ProtectedResourceDetails resource, String callback) throws OAuthRequestFailedException
resource
- The protected resource for which to get a consumer token.callback
- The callback URL.OAuthRequestFailedException
OAuthConsumerToken getAccessToken(OAuthConsumerToken requestToken, String verifier) throws OAuthRequestFailedException
requestToken
- The (presumably authorized) request token.verifier
- The token verifier.OAuthRequestFailedException
OAuthConsumerToken getAccessToken(ProtectedResourceDetails resource, OAuthConsumerToken requestToken, String verifier)
resource
- The resource for which to get the access token.requestToken
- The (presumably authorized) request token.verifier
- The token verifier.InputStream readProtectedResource(URL url, OAuthConsumerToken accessToken, String httpMethod) throws OAuthRequestFailedException
url
- The URL.accessToken
- The access token.httpMethod
- The HTTP method.OAuthRequestFailedException
URL configureURLForProtectedAccess(URL url, OAuthConsumerToken accessToken, String httpMethod, Map<String,String> additionalParameters) throws OAuthRequestFailedException
url
- The base URL.accessToken
- The access token.httpMethod
- The HTTP method.additionalParameters
- Any additional request parameters.OAuthRequestFailedException
String getAuthorizationHeader(ProtectedResourceDetails details, OAuthConsumerToken accessToken, URL url, String httpMethod, Map<String,String> additionalParameters)
details
- The details of the protected resource.accessToken
- The access token.url
- The URL of the request.httpMethod
- The http method for the protected resource.additionalParameters
- Any additional request parameters.String getOAuthQueryString(ProtectedResourceDetails details, OAuthConsumerToken accessToken, URL url, String httpMethod, Map<String,String> additionalParameters)
details
- The resource details.accessToken
- The access token.url
- The URLhttpMethod
- The http method.additionalParameters
- Any additional OAuth request parameters.Copyright © 2019. All rights reserved.