public class DsePlainTextAuthProvider extends Object implements AuthProvider
Cluster cluster = Cluster.builder() .addContactPoint(hostname) .withAuthProvider(new DsePlainTextAuthProvider("username", "password")) .build();
NONE
Constructor and Description |
---|
DsePlainTextAuthProvider(String username,
String password)
Creates an
AuthProvider for the given username and password. |
DsePlainTextAuthProvider(String username,
String password,
String authorizationId)
Creates an
AuthProvider for the given authentication ID (username),
password and authorization ID (authorizationId). |
Modifier and Type | Method and Description |
---|---|
Authenticator |
newAuthenticator(InetSocketAddress host,
String authenticator)
The
Authenticator to use when connecting to host |
public DsePlainTextAuthProvider(String username, String password)
AuthProvider
for the given username and password.username
- The username; cannot be null
.password
- The password; cannot be null
.public DsePlainTextAuthProvider(String username, String password, String authorizationId)
AuthProvider
for the given authentication ID (username),
password and authorization ID (authorizationId).
Providing an authorization ID allows the currently authenticated user
to act as a different user (a.k.a. proxy authentication).username
- The username; cannot be null
.password
- The password; cannot be null
.authorizationId
- The authorization ID; cannot be null
.public Authenticator newAuthenticator(InetSocketAddress host, String authenticator) throws AuthenticationException
AuthProvider
Authenticator
to use when connecting to host
newAuthenticator
in interface AuthProvider
host
- the Cassandra host to connect to.authenticator
- the configured authenticator on the host.AuthenticationException
Copyright © 2012–2018. All rights reserved.