Class OAuth1BuilderImpl
- java.lang.Object
-
- org.glassfish.jersey.client.oauth1.OAuth1BuilderImpl
-
- All Implemented Interfaces:
OAuth1Builder
class OAuth1BuilderImpl extends java.lang.Object implements OAuth1Builder
OAuth 1 client builder default implementation.- Since:
- 2.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classOAuth1BuilderImpl.FilterBuilderImplOAuth 1 client filter feature builder default implementation.-
Nested classes/interfaces inherited from interface org.glassfish.jersey.client.oauth1.OAuth1Builder
OAuth1Builder.FilterFeatureBuilder, OAuth1Builder.FlowBuilder
-
-
Field Summary
Fields Modifier and Type Field Description private ConsumerCredentialsconsumerCredentialsprivate OAuth1Parametersparamsprivate OAuth1Secretssecrets
-
Constructor Summary
Constructors Modifier Constructor Description (package private)OAuth1BuilderImpl(ConsumerCredentials consumerCredentials)Create a new builder instance.(package private)OAuth1BuilderImpl(OAuth1Parameters params, OAuth1Secrets secrets)Create a new builder instance.privateOAuth1BuilderImpl(OAuth1Parameters params, OAuth1Secrets secrets, ConsumerCredentials consumerCredentials)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OAuth1Builder.FlowBuilderauthorizationFlow(java.lang.String requestTokenUri, java.lang.String accessTokenUri, java.lang.String authorizationUri)Get the builder ofOAuth1AuthorizationFlow.private voiddefineCredentialsParams()OAuth1Builder.FilterFeatureBuilderfeature()Get the builder offilter feature.OAuth1BuilderImplnonce(java.lang.String timestamp)Set the nonce.OAuth1BuilderImplrealm(java.lang.String realm)Set the realm to which the user wants to authenticate.OAuth1BuilderImplsignatureMethod(java.lang.String signatureMethod)Set the signature method name.OAuth1BuilderImpltimestamp(java.lang.String timestamp)Set the timestamp.OAuth1BuilderImplversion(java.lang.String timestamp)Set the version of the OAuth protocol.
-
-
-
Field Detail
-
params
private final OAuth1Parameters params
-
secrets
private final OAuth1Secrets secrets
-
consumerCredentials
private ConsumerCredentials consumerCredentials
-
-
Constructor Detail
-
OAuth1BuilderImpl
OAuth1BuilderImpl(ConsumerCredentials consumerCredentials)
Create a new builder instance.- Parameters:
consumerCredentials- Consumer credentials.
-
OAuth1BuilderImpl
OAuth1BuilderImpl(OAuth1Parameters params, OAuth1Secrets secrets)
Create a new builder instance.- Parameters:
params- Pre-configured oauth parameters.secrets- Pre-configured oauth secrets.
-
OAuth1BuilderImpl
private OAuth1BuilderImpl(OAuth1Parameters params, OAuth1Secrets secrets, ConsumerCredentials consumerCredentials)
-
-
Method Detail
-
signatureMethod
public OAuth1BuilderImpl signatureMethod(java.lang.String signatureMethod)
Description copied from interface:OAuth1BuilderSet the signature method name. The signature methods implementOAuth1SignatureMethodand the name is retrieved fromOAuth1SignatureMethod.name()method. Build-in signature methods areHMAC-SHA1,RSA-SHA1andPLAINTEXT.Default value is
HMAC-SHA1.- Specified by:
signatureMethodin interfaceOAuth1Builder- Parameters:
signatureMethod- Signature method name.- Returns:
- This builder instance.
-
realm
public OAuth1BuilderImpl realm(java.lang.String realm)
Description copied from interface:OAuth1BuilderSet the realm to which the user wants to authenticate. The parameter will be sent in Authenticated request and used during Authorization Flow.- Specified by:
realmin interfaceOAuth1Builder- Parameters:
realm- Realm on the server to which the user authentication is required.- Returns:
- This builder instance.
-
timestamp
public OAuth1BuilderImpl timestamp(java.lang.String timestamp)
Description copied from interface:OAuth1BuilderSet the timestamp. The timestamp if defined will be used inAuthorizationheader. Usually this parameter is not defined explicitly by this method and will be automatically filled with the current time during the request.- Specified by:
timestampin interfaceOAuth1Builder- Parameters:
timestamp- Timestamp value.- Returns:
- This builder instance.
-
nonce
public OAuth1BuilderImpl nonce(java.lang.String timestamp)
Description copied from interface:OAuth1BuilderSet the nonce. Nonce (shortcut of "number used once") is used to uniquely identify the request and prevent from multiple usage of the same signed request. The nonce if defined will be used in theAuthorizationheader if defined. Usually this parameter is not defined explicitly by this method and will be automatically filled with the randomly generated UID during the request.- Specified by:
noncein interfaceOAuth1Builder- Parameters:
timestamp- Nonce value.- Returns:
- This builder instance.
-
version
public OAuth1BuilderImpl version(java.lang.String timestamp)
Description copied from interface:OAuth1BuilderSet the version of the OAuth protocol. The version, if defined, will be used in theAuthorizationheader otherwise default value1.1will be used. Usually this parameter does not need to be overwritten by this method.- Specified by:
versionin interfaceOAuth1Builder- Parameters:
timestamp- OAuth protocol version parameter.- Returns:
- This builder instance.
-
feature
public OAuth1Builder.FilterFeatureBuilder feature()
Description copied from interface:OAuth1BuilderGet the builder offilter feature.- Specified by:
featurein interfaceOAuth1Builder- Returns:
- The builder that can be used to build
OAuth1ClientFeature.
-
defineCredentialsParams
private void defineCredentialsParams()
-
authorizationFlow
public OAuth1Builder.FlowBuilder authorizationFlow(java.lang.String requestTokenUri, java.lang.String accessTokenUri, java.lang.String authorizationUri)
Description copied from interface:OAuth1BuilderGet the builder ofOAuth1AuthorizationFlow.- Specified by:
authorizationFlowin interfaceOAuth1Builder- Parameters:
requestTokenUri- URI of the endpoint on the Authorization Server where Request Token can be obtained. The URI is defined by the Service Provider.accessTokenUri- URI of the endpoint on the Authorization Server where Access Token can be obtained. The URI is defined by the Service Provider.authorizationUri- URI of the endpoint on the Authorization Server to which the user (resource owner) should be redirected in order to grant access to this application (our consumer). The URI is defined by the Service Provider.- Returns:
- The builder that can be used to build
OAuth1AuthorizationFlow.
-
-