Class OAuth1ClientFeature
- java.lang.Object
-
- org.glassfish.jersey.client.oauth1.OAuth1ClientFeature
-
- All Implemented Interfaces:
javax.ws.rs.core.Feature
final class OAuth1ClientFeature extends java.lang.Object implements javax.ws.rs.core.Feature
OAuth1 client filter feature registers the support for performing authenticated requests to the Service Provider. The feature does not perform Authorization Flow (seeOAuth1AuthorizationFlow
for details how to use Authorization Flow and retrieve Access Token). The feature usesConsumerCredentials
andAccessToken
to initialize the internalfilter
which will addAuthorization
headers containing OAuth authorization information including the oauth signature.The internal filter can be controlled by properties put into the
Example of using specific access token for one request:client request
usingClientRequestContext.setProperty(String, Object)
method. The property keys are defined in this class as a static variables (see their javadocs for usage). Using these properties a specificAccessToken
can be defined for each request for example.final Response response = client.target("foo").request() .property(OAUTH_PROPERTY_ACCESS_TOKEN, new AccessToken("ab454f84e", "f454de848a54b")).get();
See
OAuth1Builder
for more information of how to build this feature.- Since:
- 2.3
-
-
Field Summary
Fields Modifier and Type Field Description private OAuth1Parameters
parameters
private OAuth1Secrets
secrets
-
Constructor Summary
Constructors Constructor Description OAuth1ClientFeature(OAuth1Parameters parameters, OAuth1Secrets secrets)
Create a new feature.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
configure(javax.ws.rs.core.FeatureContext context)
-
-
-
Field Detail
-
parameters
private final OAuth1Parameters parameters
-
secrets
private final OAuth1Secrets secrets
-
-
Constructor Detail
-
OAuth1ClientFeature
OAuth1ClientFeature(OAuth1Parameters parameters, OAuth1Secrets secrets)
Create a new feature.- Parameters:
parameters
- OAuth parameters.secrets
- OAuth client/token secret.
-
-