Package io.stargate.sdk.http.auth
Class TokenProviderHttpAuth
java.lang.Object
io.stargate.sdk.http.auth.TokenProviderHttpAuth
- All Implemented Interfaces:
ApiConstants,TokenProvider,Supplier<String>
Using the authentication endpoint you shoud be able tp...
- Author:
- Cedrick LUNVEN (@clunven)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault URL for a Stargate node.static final StringDefault password for Cassandra.static DurationDefualt Timeout for Stargate token (1800s).static final StringDefault username for Cassandra.protected Loadbalancer<String> Get Topology of the nodes.Fields inherited from interface io.stargate.sdk.api.ApiConstants
CONTENT_TYPE_GRAPHQL, CONTENT_TYPE_JSON, HEADER_ACCEPT, HEADER_AUTHORIZATION, HEADER_CASSANDRA, HEADER_CONTENT_TYPE, HEADER_REQUEST_ID, HEADER_REQUESTED_WITH, HEADER_USER_AGENT, REQUEST_WITH -
Constructor Summary
ConstructorsConstructorDescriptionUsing defautlsTokenProviderHttpAuth(String username, String password) Overrriding credentials.TokenProviderHttpAuth(String username, String password, String url) Full fledge constructor.TokenProviderHttpAuth(String username, String password, String... url) Credentials and auth url customize.TokenProviderHttpAuth(String username, String password, List<String> url) Full fledge constructor.TokenProviderHttpAuth(List<String> url) Full fledge constructor. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.stargate.sdk.api.TokenProvider
get
-
Field Details
-
DEFAULT_USERNAME
Default username for Cassandra.- See Also:
-
DEFAULT_PASSWORD
Default password for Cassandra.- See Also:
-
DEFAULT_AUTH_URL
Default URL for a Stargate node.- See Also:
-
DEFAULT_TIMEOUT_TOKEN
Defualt Timeout for Stargate token (1800s). -
endPointAuthenticationLB
Get Topology of the nodes.
-
-
Constructor Details
-
TokenProviderHttpAuth
public TokenProviderHttpAuth()Using defautls -
TokenProviderHttpAuth
Overrriding credentials.- Parameters:
username- usernamepassword- password
-
TokenProviderHttpAuth
Credentials and auth url customize.- Parameters:
username- usernamepassword- passwordurl- endpoint to authenticate.
-
TokenProviderHttpAuth
Full fledge constructor.- Parameters:
username- usernamepassword- passwordurl- endpoint to authenticate.
-
TokenProviderHttpAuth
Full fledge constructor.- Parameters:
url- endpoint to authenticate.
-
TokenProviderHttpAuth
Full fledge constructor.- Parameters:
username- usernamepassword- passwordurl- endpoint to authenticate.
-
-
Method Details
-
getToken
Generate or renew authentication token.- Specified by:
getTokenin interfaceTokenProvider- Returns:
- String
-