Search in sources :

Example 6 with AuthenticationException

use of org.apache.cassandra.exceptions.AuthenticationException in project cassandra by apache.

the class CredentialsMessage method execute.

public Message.Response execute(QueryState state, long queryStartNanoTime) {
    try {
        AuthenticatedUser user = DatabaseDescriptor.getAuthenticator().legacyAuthenticate(credentials);
        state.getClientState().login(user);
        AuthMetrics.instance.markSuccess();
    } catch (AuthenticationException e) {
        AuthMetrics.instance.markFailure();
        return ErrorMessage.fromException(e);
    }
    return new ReadyMessage();
}
Also used : AuthenticationException(org.apache.cassandra.exceptions.AuthenticationException) AuthenticatedUser(org.apache.cassandra.auth.AuthenticatedUser)

Aggregations

AuthenticationException (org.apache.cassandra.exceptions.AuthenticationException)6 AuthenticatedUser (org.apache.cassandra.auth.AuthenticatedUser)2 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 FailedLoginException (javax.security.auth.login.FailedLoginException)1 LoginException (javax.security.auth.login.LoginException)1 IAuthenticator (org.apache.cassandra.auth.IAuthenticator)1 UntypedResultSet (org.apache.cassandra.cql3.UntypedResultSet)1 SelectStatement (org.apache.cassandra.cql3.statements.SelectStatement)1 RequestExecutionException (org.apache.cassandra.exceptions.RequestExecutionException)1 ResultMessage (org.apache.cassandra.transport.messages.ResultMessage)1