Class ClientAuthentication


  • public class ClientAuthentication
    extends Object
    Represents different methods of authenticating with the App Search Server
    • Method Detail

      • withBearerAuth

        public static ClientAuthentication withBearerAuth​(String token)
        Create an authentication object using a bearer token
        Parameters:
        token - The token value. Generally starts with 'private-' or 'search-'
        Returns:
        A token based ClientAuthentication
      • withBasicAuth

        public static ClientAuthentication withBasicAuth​(String username,
                                                         String password)
        Create an authentication object using username and password authentication
        Parameters:
        username - the username
        password - the password
        Returns:
        A client authentication object
      • getUsername

        public String getUsername()
        Optional, if using BASIC authentication this is the username
        Returns:
        The username
      • getPassword

        public String getPassword()
        Optional, if using BASIC authentication this is the password
        Returns:
        the password
      • getToken

        public String getToken()
        Optional, Either an API Key or Elasticsearch tokens
        Returns:
        The API Key or token