public final class OAuthClientUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
OAuthClientUtils.Consumer
Simple consumer representation
|
static class |
OAuthClientUtils.Token
Simple token representation
|
Modifier and Type | Method and Description |
---|---|
static String |
createAuthorizationHeader(OAuthClientUtils.Consumer consumer)
Creates OAuth Authorization header containing consumer key and secret values only
|
static String |
createAuthorizationHeader(OAuthClientUtils.Consumer consumer,
OAuthClientUtils.Token accessToken,
String method,
String requestURI)
Creates OAuth Authorization header
|
static String |
createAuthorizationHeader(OAuthClientUtils.Consumer consumer,
OAuthClientUtils.Token accessToken,
String method,
String requestURI,
Map<String,Object> oauthConsumerProps) |
static OAuthClientUtils.Token |
getAccessToken(WebClient accessTokenService,
OAuthClientUtils.Consumer consumer,
OAuthClientUtils.Token requestToken,
String verifier)
Returns a simple representation of the Access token
|
static OAuthClientUtils.Token |
getAccessToken(WebClient accessTokenService,
OAuthClientUtils.Consumer consumer,
OAuthClientUtils.Token requestToken,
String verifier,
Map<String,Object> oauthConsumerProps) |
static URI |
getAuthorizationURI(String authorizationServiceURI,
String requestToken)
Returns URI of the authorization service with the query parameter containing
the request token key
|
static OAuthClientUtils.Token |
getRequestToken(WebClient requestTokenService,
OAuthClientUtils.Consumer consumer,
URI callback,
Map<String,String> extraParams)
Returns a simple representation of the Request token
|
static OAuthClientUtils.Token |
getRequestToken(WebClient requestTokenService,
OAuthClientUtils.Consumer consumer,
URI callback,
Map<String,String> extraParams,
Map<String,Object> oauthConsumerProps) |
static Map<String,Object> |
prepareOAuthRsaProperties(PrivateKey pk) |
public static URI getAuthorizationURI(String authorizationServiceURI, String requestToken)
authorizationServiceURI
- the service URIrequestToken
- the request token keypublic static OAuthClientUtils.Token getRequestToken(WebClient requestTokenService, OAuthClientUtils.Consumer consumer, URI callback, Map<String,String> extraParams) throws OAuthServiceException
requestTokenService
- initialized RequestToken service clientconsumer
- Consumer bean containing the consumer key and secretcallback
- the callback URI where the request token verifier will
be returnedextraParams
- additional parameters such as state, scope, etcOAuthServiceException
public static Map<String,Object> prepareOAuthRsaProperties(PrivateKey pk)
public static OAuthClientUtils.Token getRequestToken(WebClient requestTokenService, OAuthClientUtils.Consumer consumer, URI callback, Map<String,String> extraParams, Map<String,Object> oauthConsumerProps) throws OAuthServiceException
OAuthServiceException
public static OAuthClientUtils.Token getAccessToken(WebClient accessTokenService, OAuthClientUtils.Consumer consumer, OAuthClientUtils.Token requestToken, String verifier) throws OAuthServiceException
accessTokenService
- initialized AccessToken service clientconsumer
- Consumer bean containing the consumer key and secretverifier
- the verifier/authorization keyOAuthServiceException
public static OAuthClientUtils.Token getAccessToken(WebClient accessTokenService, OAuthClientUtils.Consumer consumer, OAuthClientUtils.Token requestToken, String verifier, Map<String,Object> oauthConsumerProps) throws OAuthServiceException
OAuthServiceException
public static String createAuthorizationHeader(OAuthClientUtils.Consumer consumer, OAuthClientUtils.Token accessToken, String method, String requestURI)
consumer
- Consumer bean containing the consumer key and secrettoken
- Access token representationmethod
- HTTP methodrequestURI
- request URIpublic static String createAuthorizationHeader(OAuthClientUtils.Consumer consumer, OAuthClientUtils.Token accessToken, String method, String requestURI, Map<String,Object> oauthConsumerProps)
public static String createAuthorizationHeader(OAuthClientUtils.Consumer consumer)
consumer
- Consumer bean containing the consumer key and secretApache CXF