Interface OAuth1Builder
-
- All Known Implementing Classes:
OAuth1BuilderImpl
public interface OAuth1Builder
Builder of OAuth 1 client support. This builder can buildOAuth1AuthorizationFlow
using a methodauthorizationFlow(String, String, String)
andfilter feature
using a methodfeature()
. Before one of these methods is invoked, properties common for both features can be defined using methods of this builder. However, for default OAuth configuration there should not be no need to call theseset*
methods of this builder and the builder can be directly used to build mentioned features.- Since:
- 2.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
OAuth1Builder.FilterFeatureBuilder
Builder of theFeature
.static interface
OAuth1Builder.FlowBuilder
Builder of theOAuth1AuthorizationFlow
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OAuth1Builder.FlowBuilder
authorizationFlow(java.lang.String requestTokenUri, java.lang.String accessTokenUri, java.lang.String authorizationUri)
Get the builder ofOAuth1AuthorizationFlow
.OAuth1Builder.FilterFeatureBuilder
feature()
Get the builder offilter feature
.OAuth1Builder
nonce(java.lang.String nonce)
Set the nonce.OAuth1Builder
realm(java.lang.String realm)
Set the realm to which the user wants to authenticate.OAuth1Builder
signatureMethod(java.lang.String signatureMethod)
Set the signature method name.OAuth1Builder
timestamp(java.lang.String timestamp)
Set the timestamp.OAuth1Builder
version(java.lang.String version)
Set the version of the OAuth protocol.
-
-
-
Method Detail
-
signatureMethod
OAuth1Builder signatureMethod(java.lang.String signatureMethod)
Set the signature method name. The signature methods implementOAuth1SignatureMethod
and the name is retrieved fromOAuth1SignatureMethod.name()
method. Build-in signature methods areHMAC-SHA1
,RSA-SHA1
andPLAINTEXT
.Default value is
HMAC-SHA1
.- Parameters:
signatureMethod
- Signature method name.- Returns:
- This builder instance.
-
realm
OAuth1Builder realm(java.lang.String realm)
Set the realm to which the user wants to authenticate. The parameter will be sent in Authenticated request and used during Authorization Flow.- Parameters:
realm
- Realm on the server to which the user authentication is required.- Returns:
- This builder instance.
-
timestamp
OAuth1Builder timestamp(java.lang.String timestamp)
Set the timestamp. The timestamp if defined will be used inAuthorization
header. Usually this parameter is not defined explicitly by this method and will be automatically filled with the current time during the request.- Parameters:
timestamp
- Timestamp value.- Returns:
- This builder instance.
-
nonce
OAuth1Builder nonce(java.lang.String nonce)
Set 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 theAuthorization
header 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.- Parameters:
nonce
- Nonce value.- Returns:
- This builder instance.
-
version
OAuth1Builder version(java.lang.String version)
Set the version of the OAuth protocol. The version, if defined, will be used in theAuthorization
header otherwise default value1.1
will be used. Usually this parameter does not need to be overwritten by this method.- Parameters:
version
- OAuth protocol version parameter.- Returns:
- This builder instance.
-
feature
OAuth1Builder.FilterFeatureBuilder feature()
Get the builder offilter feature
.- Returns:
- The builder that can be used to build
OAuth1ClientFeature
.
-
authorizationFlow
OAuth1Builder.FlowBuilder authorizationFlow(java.lang.String requestTokenUri, java.lang.String accessTokenUri, java.lang.String authorizationUri)
Get the builder ofOAuth1AuthorizationFlow
.- 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
.
-
-