public class PlainTextAuthProvider extends Object implements ExtendedAuthProvider
AuthProvider implementation.
This provider allows to programmatically define authentication information that will then apply to all hosts. The PlainTextAuthenticator instances it returns support SASL authentication using the PLAIN mechanism for version 2 (or above) of the CQL native protocol.
ExtendedAuthProvider.NoAuthProviderAuthProvider.TransitionalModePlainTextAuthenticatorNONE| Constructor and Description |
|---|
PlainTextAuthProvider(String username,
String password)
Creates a new simple authentication information provider with the supplied credentials.
|
| Modifier and Type | Method and Description |
|---|---|
Authenticator |
newAuthenticator(EndPoint host,
String authenticator)
Uses the supplied credentials and the SASL PLAIN mechanism to login to the server.
|
Authenticator |
newAuthenticator(InetSocketAddress host,
String authenticator)
The
Authenticator to use when connecting to host |
void |
setPassword(String password)
Changes the password.
|
void |
setUsername(String username)
Changes the user name.
|
public void setUsername(String username)
The new credentials will be used for all connections initiated after this method was called.
username - the new name.public void setPassword(String password)
The new credentials will be used for all connections initiated after this method was called.
password - the new password.public Authenticator newAuthenticator(EndPoint host, String authenticator)
newAuthenticator in interface ExtendedAuthProviderhost - the Cassandra host with which we want to authenticateauthenticator - the configured authenticator on the hostpublic Authenticator newAuthenticator(InetSocketAddress host, String authenticator) throws AuthenticationException
AuthProviderAuthenticator to use when connecting to hostnewAuthenticator in interface AuthProvidernewAuthenticator in interface ExtendedAuthProviderhost - the Cassandra host to connect to.authenticator - the configured authenticator on the host.AuthenticationExceptionCopyright © 2012–2023. All rights reserved.