Class OAuth1BuilderImpl

java.lang.Object
org.glassfish.jersey.client.oauth1.OAuth1BuilderImpl
All Implemented Interfaces:
OAuth1Builder

class OAuth1BuilderImpl extends Object implements OAuth1Builder
OAuth 1 client builder default implementation.
Since:
2.3
  • Field Details

  • Constructor Details

    • 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 Details

    • signatureMethod

      public OAuth1BuilderImpl signatureMethod(String signatureMethod)
      Description copied from interface: OAuth1Builder
      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.

      Specified by:
      signatureMethod in interface OAuth1Builder
      Parameters:
      signatureMethod - Signature method name.
      Returns:
      This builder instance.
    • realm

      public OAuth1BuilderImpl realm(String realm)
      Description copied from interface: OAuth1Builder
      Set the realm to which the user wants to authenticate. The parameter will be sent in Authenticated request and used during Authorization Flow.
      Specified by:
      realm in interface OAuth1Builder
      Parameters:
      realm - Realm on the server to which the user authentication is required.
      Returns:
      This builder instance.
    • timestamp

      public OAuth1BuilderImpl timestamp(String timestamp)
      Description copied from interface: OAuth1Builder
      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.
      Specified by:
      timestamp in interface OAuth1Builder
      Parameters:
      timestamp - Timestamp value.
      Returns:
      This builder instance.
    • nonce

      public OAuth1BuilderImpl nonce(String timestamp)
      Description copied from interface: OAuth1Builder
      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.
      Specified by:
      nonce in interface OAuth1Builder
      Parameters:
      timestamp - Nonce value.
      Returns:
      This builder instance.
    • version

      public OAuth1BuilderImpl version(String timestamp)
      Description copied from interface: OAuth1Builder
      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.
      Specified by:
      version in interface OAuth1Builder
      Parameters:
      timestamp - OAuth protocol version parameter.
      Returns:
      This builder instance.
    • feature

      Description copied from interface: OAuth1Builder
      Get the builder of filter feature.
      Specified by:
      feature in interface OAuth1Builder
      Returns:
      The builder that can be used to build OAuth1ClientFeature.
    • defineCredentialsParams

      private void defineCredentialsParams()
    • authorizationFlow

      public OAuth1Builder.FlowBuilder authorizationFlow(String requestTokenUri, String accessTokenUri, String authorizationUri)
      Description copied from interface: OAuth1Builder
      Get the builder of OAuth1AuthorizationFlow.
      Specified by:
      authorizationFlow in interface OAuth1Builder
      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.