org.glassfish.jersey.client.oauth1
Interface OAuth1Builder


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
Author:
Miroslav Fuksa (miroslav.fuksa at oracle.com)

Nested Class Summary
static interface OAuth1Builder.FilterFeatureBuilder
          Builder of the Feature.
static interface OAuth1Builder.FlowBuilder
          Builder of the OAuth1AuthorizationFlow.
 
Method Summary
 OAuth1Builder.FlowBuilder authorizationFlow(String requestTokenUri, String accessTokenUri, String authorizationUri)
          Get the builder of OAuth1AuthorizationFlow.
 OAuth1Builder.FilterFeatureBuilder feature()
          Get the builder of filter feature.
 OAuth1Builder nonce(String nonce)
          Set the nonce.
 OAuth1Builder realm(String realm)
          Set the realm to which the user wants to authenticate.
 OAuth1Builder signatureMethod(String signatureMethod)
          Set the signature method name.
 OAuth1Builder timestamp(String timestamp)
          Set the timestamp.
 OAuth1Builder version(String version)
          Set the version of the OAuth protocol.
 

Method Detail

signatureMethod

OAuth1Builder signatureMethod(String signatureMethod)
Set the signature method name. The signature methods implement OAuth1SignatureMethod and the name is retrieved from OAuth1SignatureMethod.name() method. Build-in signature methods are HMAC-SHA1, RSA-SHA1 and PLAINTEXT.

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 in Authorization 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(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 the Authorization 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(String version)
Set the version of the OAuth protocol. The version, if defined, will be used in the Authorization header otherwise default value 1.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 of filter feature.

Returns:
The builder that can be used to build OAuth1ClientFeature.

authorizationFlow

OAuth1Builder.FlowBuilder authorizationFlow(String requestTokenUri,
                                            String accessTokenUri,
                                            String authorizationUri)
Get the builder of OAuth1AuthorizationFlow.

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.


Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.