Interface OAuth1Builder
- All Known Implementing Classes:
OAuth1BuilderImpl
public interface OAuth1Builder
Builder of OAuth 1 client support. This builder can build
OAuth1AuthorizationFlow
using a method
authorizationFlow(String, String, String)
and filter feature
using a method
feature()
. 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 these set*
methods of this builder and the builder can be directly used to build
mentioned features.- Since:
- 2.3
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Builder of theFeature
.static interface
Builder of theOAuth1AuthorizationFlow
. -
Method Summary
Modifier and TypeMethodDescriptionauthorizationFlow
(String requestTokenUri, String accessTokenUri, String authorizationUri) Get the builder ofOAuth1AuthorizationFlow
.feature()
Get the builder offilter feature
.Set the nonce.Set the realm to which the user wants to authenticate.signatureMethod
(String signatureMethod) Set the signature method name.Set the timestamp.Set the version of the OAuth protocol.
-
Method Details
-
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
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
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
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
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(String requestTokenUri, String accessTokenUri, 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
.
-