public class DsePlainTextAuthProvider extends Object implements ExtendedAuthProvider
To create a cluster using this auth provider:
Cluster cluster = Cluster.builder() .addContactPoint(hostname) .withAuthProvider(new DsePlainTextAuthProvider("username", "password")) .build();
AuthProvider.NoAuthProvider, AuthProvider.TransitionalModePlainTextAuthenticator
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(EndPoint endPoint,
String authenticator)
The
Authenticator to use when connecting to endpoint . |
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(EndPoint endPoint, String authenticator) throws AuthenticationException
ExtendedAuthProvider
Authenticator
to use when connecting to endpoint
.newAuthenticator
in interface ExtendedAuthProvider
endPoint
- the Cassandra host to connect to.authenticator
- the configured authenticator on the host.AuthenticationException
public Authenticator newAuthenticator(InetSocketAddress host, String authenticator) throws AuthenticationException
AuthProvider
Authenticator
to use when connecting to host
newAuthenticator
in interface AuthProvider
newAuthenticator
in interface ExtendedAuthProvider
host
- the Cassandra host to connect to.authenticator
- the configured authenticator on the host.AuthenticationException
Copyright © 2012–2019. All rights reserved.