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.FeatureOAuth1 client filter feature registers the support for performing authenticated requests to the Service Provider. The feature does not perform Authorization Flow (seeOAuth1AuthorizationFlowfor details how to use Authorization Flow and retrieve Access Token). The feature usesConsumerCredentialsandAccessTokento initialize the internalfilterwhich will addAuthorizationheaders 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 requestusingClientRequestContext.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 specificAccessTokencan 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
OAuth1Builderfor more information of how to build this feature.- Since:
- 2.3
-
-
Field Summary
Fields Modifier and Type Field Description private OAuth1Parametersparametersprivate OAuth1Secretssecrets
-
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 booleanconfigure(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.
-
-