Class OAuth1ClientSupport
- java.lang.Object
-
- org.glassfish.jersey.client.oauth1.OAuth1ClientSupport
-
public final class OAuth1ClientSupport extends java.lang.Object
The main class to build the support for OAuth 1 into the Jersey client.The support for OAuth is divided into two parts:
- Authorization Flow: process of acquiring the user
approval for accessing user's resources on the Service Provider. The authorization process is managed
by an implementation of
OAuth1AuthorizationFlow
interface. The result of the process is anAccessToken
. - Authenticated Requests: requests done by a
client
are enhanced by anAuthorization
http header that contains OAuth1 authorization information based on theAccessToken
received from Authorization flow. This support is provided byoauth 1 filter feature
that is registered into client configuration.
- Since:
- 2.3
- Authorization Flow: process of acquiring the user
approval for accessing user's resources on the Service Provider. The authorization process is managed
by an implementation of
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
OAUTH_PROPERTY_ACCESS_TOKEN
Key of the property that can be attached to theclient request
usingClientRequestContext.setProperty(String, Object)
and that definesaccess token
that should be used when generating OAuthAuthorization
http header.static java.lang.String
OAUTH_PROPERTY_CONSUMER_CREDENTIALS
Key of the property that can be attached to theclient request
usingClientRequestContext.setProperty(String, Object)
and that definesconsumer credentials
that should be used when generating OAuthAuthorization
http header.static java.lang.String
OAUTH_PROPERTY_OAUTH_PARAMETERS
Key of the property that can be attached to theclient request
usingClientRequestContext.setProperty(String, Object)
and that definesOAuth1Parameters
that should be used when generating OAuthAuthorization
http header.static java.lang.String
OAUTH_PROPERTY_OAUTH_SECRETS
Key of the property that can be attached to theclient request
usingClientRequestContext.setProperty(String, Object)
and that definesOAuth1Secrets
that should be used when generating OAuthAuthorization
http header.
-
Constructor Summary
Constructors Modifier Constructor Description private
OAuth1ClientSupport()
Prevent instantiation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OAuth1Builder
builder(ConsumerCredentials consumerCredentials)
Get a new builder of OAuth1 client support.
-
-
-
Field Detail
-
OAUTH_PROPERTY_CONSUMER_CREDENTIALS
public static final java.lang.String OAUTH_PROPERTY_CONSUMER_CREDENTIALS
Key of the property that can be attached to theclient request
usingClientRequestContext.setProperty(String, Object)
and that definesconsumer credentials
that should be used when generating OAuthAuthorization
http header. The property will override the setting of the internalfilter
for the current request only.The value of the property must be
ConsumerCredentials
instance.- See Also:
- Constant Field Values
-
OAUTH_PROPERTY_ACCESS_TOKEN
public static final java.lang.String OAUTH_PROPERTY_ACCESS_TOKEN
Key of the property that can be attached to theclient request
usingClientRequestContext.setProperty(String, Object)
and that definesaccess token
that should be used when generating OAuthAuthorization
http header. The property will override the setting of the internalfilter
for the current request only.The value of the property must be
AccessToken
instance.- See Also:
- Constant Field Values
-
OAUTH_PROPERTY_OAUTH_PARAMETERS
public static final java.lang.String OAUTH_PROPERTY_OAUTH_PARAMETERS
Key of the property that can be attached to theclient request
usingClientRequestContext.setProperty(String, Object)
and that definesOAuth1Parameters
that should be used when generating OAuthAuthorization
http header. The property will override the setting of the internalfilter
for the current request only.The value of the property must be
OAuth1Parameters
instance.This property is for advanced usage and should not be used if not needed as it can make the filter configuration inconsistent for the request and can produce unwanted results.
This property should be used only for configuring an instance of
OAuth feature
, not theAuthorization flow
.- See Also:
- Constant Field Values
-
OAUTH_PROPERTY_OAUTH_SECRETS
public static final java.lang.String OAUTH_PROPERTY_OAUTH_SECRETS
Key of the property that can be attached to theclient request
usingClientRequestContext.setProperty(String, Object)
and that definesOAuth1Secrets
that should be used when generating OAuthAuthorization
http header. The property will override the setting of the internalfilter
for the current request only.The value of the property must be
OAuth1Secrets
instance.This property is for advanced usage and should not be used if not needed as it can make the filter configuration inconsistent for the request and can produce unwanted results.
This property should be used only for configuring an instance of
OAuth feature
, not theAuthorization flow
.- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
public static OAuth1Builder builder(ConsumerCredentials consumerCredentials)
Get a new builder of OAuth1 client support.- Parameters:
consumerCredentials
- Consumer credentials issued by the service provider for the application that wants to access data.- Returns:
- Builder instance.
-
-