Class HttpAuthentication

java.lang.Object
com.ebasetech.xi.services.HttpAuthentication

public class HttpAuthentication
extends java.lang.Object
HttpAuthentication is a convenience class to create HTTP Authentication objects. Each object stores the attributes required for the type of authentication required. Contains the following methods:
  • Constructor Summary

    Constructors
    Constructor Description
    HttpAuthentication()  
  • Method Summary

    Modifier and Type Method Description
    static com.ebasetech.xi.services.auth.BasicAuthentication createBasicAuthentication​(java.lang.String username, java.lang.String password)
    Returns a BasicAuthentication object that stores the username and password required for HTTP Basic Authenication
    static com.ebasetech.xi.services.auth.DigestAuthentication createDigestAuthentication​(java.lang.String username, java.lang.String password)
    Returns a DigestAuthentication object that stores the username and password required for HTTP Digest Authenication
    static com.ebasetech.xi.services.auth.GatewayAuthentication createGatewayAuthentication​(java.lang.String gatewayId)
    Returns new GatewayAuthentication object that stores the name of the configured Gateway Server on the server.
    static com.ebasetech.xi.services.auth.NTLMAuthentication createNTLMAuthentication​(java.lang.String username, java.lang.String password, java.lang.String workstation, java.lang.String domain)
    Returns a NTLMAuthentication object that stores the username, password, workstation and domain required for HTTP NTLM Authenication
    static com.ebasetech.xi.services.auth.OAuthAuthentication createOAuthAuthentication​(java.lang.String name)
    Returns an OAuthAuthentication object that stores the name of the configured OAuth configuration on the server
    static com.ebasetech.xi.services.auth.OAuthAuthentication createOAuthAuthentication​(java.lang.String name, java.lang.String scope)
    Returns an OAuthAuthentication object that stores the name of the configured OAuth configuration on the server.
    static com.ebasetech.xi.services.auth.OAuthAuthentication createOAuthAuthentication​(java.lang.String name, java.lang.String scope, java.lang.String username, java.lang.String password)
    Returns an OAuthAuthentication object that stores the name of the configured OAuth configuration on the server.
    static com.ebasetech.xi.services.auth.OAuthAuthentication createOAuthAuthentication​(java.lang.String name, java.lang.String scope, java.lang.String username, java.lang.String password, java.util.Map<java.lang.String,​java.lang.Object> additionalParameters)
    Returns an OAuthAuthentication object that stores the name of the configured OAuth configuration on the server.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HttpAuthentication

      public HttpAuthentication()
  • Method Details

    • createBasicAuthentication

      public static com.ebasetech.xi.services.auth.BasicAuthentication createBasicAuthentication​(java.lang.String username, java.lang.String password)
      Returns a BasicAuthentication object that stores the username and password required for HTTP Basic Authenication

      Example:

       var auth = HttpAuthentication.createBasicAuthentication("username", "password");
       var response = services.rest.get(.., .., .., auth);
       
      Since:
      v5.1
      See Also:
      BasicAuthentication
    • createDigestAuthentication

      public static com.ebasetech.xi.services.auth.DigestAuthentication createDigestAuthentication​(java.lang.String username, java.lang.String password)
      Returns a DigestAuthentication object that stores the username and password required for HTTP Digest Authenication

      Example:

       var auth = HttpAuthentication.createDigestAuthentication("username", "password");
       var response = services.rest.get(.., .., .., auth);
       
      Since:
      v5.1
      See Also:
      DigestAuthentication
    • createNTLMAuthentication

      public static com.ebasetech.xi.services.auth.NTLMAuthentication createNTLMAuthentication​(java.lang.String username, java.lang.String password, java.lang.String workstation, java.lang.String domain)
      Returns a NTLMAuthentication object that stores the username, password, workstation and domain required for HTTP NTLM Authenication

      Example:

       var auth = HttpAuthentication.createNTLMAuthentication("username", "password", "workstation", "domainname");
       var response = services.rest.get(.., .., .., auth);
       // alternative
       var auth2 = HttpAuthentication.createNTLMAuthentication("domainname\\username", "password", null, null);
       
      Since:
      v5.1
      See Also:
      NTLMAuthentication
    • createOAuthAuthentication

      public static com.ebasetech.xi.services.auth.OAuthAuthentication createOAuthAuthentication​(java.lang.String name)
      Returns an OAuthAuthentication object that stores the name of the configured OAuth configuration on the server

      Example:

       var auth = HttpAuthentication.createOAuthAuthentication("oauthconfigname");
       var response = services.rest.get(.., .., .., auth);
       
      Further documentation.
      Since:
      v5.1
      See Also:
      OAuthAuthentication
    • createOAuthAuthentication

      public static com.ebasetech.xi.services.auth.OAuthAuthentication createOAuthAuthentication​(java.lang.String name, java.lang.String scope)
      Returns an OAuthAuthentication object that stores the name of the configured OAuth configuration on the server. This function should be used the client credential grant OAuth method that requires a scope parameter, otherwise use createOAuthAuthentication(String). The scope parameter overrides the scope configured on the server administrator application.

      Example:

       var auth = HttpAuthentication.createOAuthAuthentication("oauthconfigname", "private-read");
       var response = services.rest.get(.., .., .., auth);
       
      Further documentation.
      Since:
      v5.1
      See Also:
      OAuthAuthentication, createOAuthAuthentication(String)
    • createOAuthAuthentication

      public static com.ebasetech.xi.services.auth.OAuthAuthentication createOAuthAuthentication​(java.lang.String name, java.lang.String scope, java.lang.String username, java.lang.String password)
      Returns an OAuthAuthentication object that stores the name of the configured OAuth configuration on the server. This function is only applicable with the resource owner password credentials grant OAuth method. The scope parameter overrides the scope configured on the server administrator application.

      Example:

       var auth = HttpAuthentication.createOAuthAuthentication("oauthconfigname", "private-read", "myusername", "mypassword");
       var response = services.rest.get(.., .., .., auth);
       
      Further documentation.
      Since:
      v5.1
      See Also:
      OAuthAuthentication
    • createOAuthAuthentication

      public static com.ebasetech.xi.services.auth.OAuthAuthentication createOAuthAuthentication​(java.lang.String name, java.lang.String scope, java.lang.String username, java.lang.String password, java.util.Map<java.lang.String,​java.lang.Object> additionalParameters)
      Returns an OAuthAuthentication object that stores the name of the configured OAuth configuration on the server. This function is only applicable with the resource owner password credentials grant OAuth method. The scope parameter overrides the scope configured on the server administrator application.

      Example:

       var params = {show_dialog : true};
       var auth = HttpAuthentication.createOAuthAuthentication("oauthconfigname", "private-read", null, null, params);
       var response = services.rest.get(.., .., .., auth);
       
      Further documentation.
      Since:
      v5.1
      See Also:
      OAuthAuthentication
    • createGatewayAuthentication

      public static com.ebasetech.xi.services.auth.GatewayAuthentication createGatewayAuthentication​(java.lang.String gatewayId)
      Returns new GatewayAuthentication object that stores the name of the configured Gateway Server on the server. This function is only applicable to Gateway Server requests
      Parameters:
      gatewayId - of the configured gateway server on the Server Admin App
      Since:
      V5.7