com.datastax.driver.core
Class PlainTextAuthProvider
java.lang.Object
com.datastax.driver.core.PlainTextAuthProvider
- All Implemented Interfaces:
- AuthProvider
public class PlainTextAuthProvider
- extends Object
- implements AuthProvider
A simple 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 of the
CQL native protocol.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PlainTextAuthProvider
public PlainTextAuthProvider(String username,
String password)
- Creates a new simple authentication information provider with the
supplied credentials.
- Parameters:
username
- to use for authentication requestspassword
- to use for authentication requests
newAuthenticator
public Authenticator newAuthenticator(InetAddress host)
- Uses the supplied credentials and the SASL PLAIN mechanism to login
to the server.
- Specified by:
newAuthenticator
in interface AuthProvider
- Parameters:
host
- the Cassandra host with which we want to authenticate
- Returns:
- an Authenticator instance which can be used to perform
authentication negotiations on behalf of the client
- Throws:
SaslException
- if an unsupported SASL mechanism is supplied
or an error is encountered when initialising the authenticator
Copyright © 2013. All Rights Reserved.