Class TokenProviderHttpAuth

java.lang.Object
io.stargate.sdk.http.auth.TokenProviderHttpAuth
All Implemented Interfaces:
ApiConstants, TokenProvider, Supplier<String>

public class TokenProviderHttpAuth extends Object implements TokenProvider, ApiConstants
Using the authentication endpoint you shoud be able tp...
Author:
Cedrick LUNVEN (@clunven)
  • Field Details

    • DEFAULT_USERNAME

      public static final String DEFAULT_USERNAME
      Default username for Cassandra.
      See Also:
    • DEFAULT_PASSWORD

      public static final String DEFAULT_PASSWORD
      Default password for Cassandra.
      See Also:
    • DEFAULT_AUTH_URL

      public static final String DEFAULT_AUTH_URL
      Default URL for a Stargate node.
      See Also:
    • DEFAULT_TIMEOUT_TOKEN

      public static Duration DEFAULT_TIMEOUT_TOKEN
      Defualt Timeout for Stargate token (1800s).
    • endPointAuthenticationLB

      protected Loadbalancer<String> endPointAuthenticationLB
      Get Topology of the nodes.
  • Constructor Details

    • TokenProviderHttpAuth

      public TokenProviderHttpAuth()
      Using defautls
    • TokenProviderHttpAuth

      public TokenProviderHttpAuth(String username, String password)
      Overrriding credentials.
      Parameters:
      username - username
      password - password
    • TokenProviderHttpAuth

      public TokenProviderHttpAuth(String username, String password, String... url)
      Credentials and auth url customize.
      Parameters:
      username - username
      password - password
      url - endpoint to authenticate.
    • TokenProviderHttpAuth

      public TokenProviderHttpAuth(String username, String password, String url)
      Full fledge constructor.
      Parameters:
      username - username
      password - password
      url - endpoint to authenticate.
    • TokenProviderHttpAuth

      public TokenProviderHttpAuth(List<String> url)
      Full fledge constructor.
      Parameters:
      url - endpoint to authenticate.
    • TokenProviderHttpAuth

      public TokenProviderHttpAuth(String username, String password, List<String> url)
      Full fledge constructor.
      Parameters:
      username - username
      password - password
      url - endpoint to authenticate.
  • Method Details

    • getToken

      public String getToken()
      Generate or renew authentication token.
      Specified by:
      getToken in interface TokenProvider
      Returns:
      String