public interface AuthProvider extends AutoCloseable
Authenticator
instances to use when connecting to Cassandra nodes.
See PlainTextAuthProvider
for an implementation which uses SASL PLAIN mechanism to
authenticate using username/password strings.
Modifier and Type | Method and Description |
---|---|
Authenticator |
newAuthenticator(EndPoint endPoint,
String serverAuthenticator)
The authenticator to use when connecting to
host . |
void |
onMissingChallenge(EndPoint endPoint)
What to do if the server does not send back an authentication challenge (in other words, lets
the client connect without any form of authentication).
|
close
@NonNull Authenticator newAuthenticator(@NonNull EndPoint endPoint, @NonNull String serverAuthenticator) throws AuthenticationException
host
.endPoint
- the Cassandra host to connect to.serverAuthenticator
- the configured authenticator on the host.AuthenticationException
void onMissingChallenge(@NonNull EndPoint endPoint) throws AuthenticationException
This is suspicious because having authentication enabled on the client but not on the server is probably a configuration mistake.
Provider implementations are free to handle this however they want; typical approaches are:
AuthenticationException
to abort the connection (but note that it
will be retried according to the ReconnectionPolicy
).
AuthenticationException
Copyright © 2017–2023. All rights reserved.