Class OAuth1ClientFeature
java.lang.Object
org.glassfish.jersey.client.oauth1.OAuth1ClientFeature
- All Implemented Interfaces:
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 (see
OAuth1AuthorizationFlow
for details how to use Authorization Flow and retrieve Access Token). The feature uses ConsumerCredentials
and AccessToken
to initialize the internal filter
which will add Authorization
headers containing OAuth authorization information including
the oauth signature.
The internal filter can be controlled by properties put into
the client request
using ClientRequestContext.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 specific
AccessToken
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 -
Constructor Summary
ConstructorsConstructorDescriptionOAuth1ClientFeature
(OAuth1Parameters parameters, OAuth1Secrets secrets) Create a new feature. -
Method Summary
-
Field Details
-
parameters
-
secrets
-
-
Constructor Details
-
OAuth1ClientFeature
OAuth1ClientFeature(OAuth1Parameters parameters, OAuth1Secrets secrets) Create a new feature.- Parameters:
parameters
- OAuth parameters.secrets
- OAuth client/token secret.
-
-
Method Details
-
configure
public boolean configure(javax.ws.rs.core.FeatureContext context) - Specified by:
configure
in interfacejavax.ws.rs.core.Feature
-