Interface OAuth1Builder
-
public interface OAuth1BuilderBuilder of OAuth 1 client support. This builder can buildOAuth1AuthorizationFlowusing a methodauthorizationFlow(String, String, String)andfilter featureusing 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
- Author:
- Miroslav Fuksa
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceOAuth1Builder.FilterFeatureBuilderBuilder of theFeature.static interfaceOAuth1Builder.FlowBuilderBuilder of theOAuth1AuthorizationFlow.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OAuth1Builder.FlowBuilderauthorizationFlow(String requestTokenUri, String accessTokenUri, String authorizationUri)Get the builder ofOAuth1AuthorizationFlow.OAuth1Builder.FilterFeatureBuilderfeature()Get the builder offilter feature.OAuth1Buildernonce(String nonce)Set the nonce.OAuth1Builderrealm(String realm)Set the realm to which the user wants to authenticate.OAuth1BuildersignatureMethod(String signatureMethod)Set the signature method name.OAuth1Buildertimestamp(String timestamp)Set the timestamp.OAuth1Builderversion(String version)Set the version of the OAuth protocol.
-
-
-
Method Detail
-
signatureMethod
OAuth1Builder signatureMethod(String signatureMethod)
Set 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.- Parameters:
signatureMethod- Signature method name.- Returns:
- This builder instance.
-
realm
OAuth1Builder realm(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(String timestamp)
Set 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.- Parameters:
timestamp- Timestamp value.- Returns:
- This builder instance.
-
nonce
OAuth1Builder nonce(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 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.- Parameters:
nonce- Nonce value.- Returns:
- This builder instance.
-
version
OAuth1Builder version(String version)
Set 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.- 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.
-
-