apache/cassandra · error · LoginException

Authentication failed

Error message

Authentication failed

What it means

FailedLoginException raised by the JAAS login module when the configured IAuthenticator's (legacy) authenticate call rejects the supplied credentials. The credentials came from the CallbackHandler initialized in initialize(); failure means the username/password pair did not match any role in system_auth (or the authenticator itself failed).

Solutions

  1. Verify the username and password against the role record in system_auth.roles
  2. Confirm the role exists, can_login is true, and is not locked or expired
  3. Check which IAuthenticator is configured and that its backing store is reachable
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/java/org/apache/cassandra/auth/CassandraLoginModule.java:102 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/54cebdadc3272cef. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/auth/CassandraLoginModule.java:102

     * Authenticate the user, obtaining credentials from the CallbackHandler
     * supplied in {@code}initialize{@code}. As long as the configured
     * {@code}IAuthenticator{@code} supports the optional
     * {@code}legacyAuthenticate{@code} method, it can be used here.
     *
     * @return true in all cases since this {@code}LoginModule{@code}
     *         should not be ignored.
     * @exception FailedLoginException if the authentication fails.
     * @exception LoginException if this {@code}LoginModule{@code} is unable to
     * perform the authentication.
     */
    @Override
    public boolean login() throws LoginException
    {
        // prompt for a user name and password
        if (callbackHandler == null)
        {
            logger.info("No CallbackHandler available for authentication");
            throw new LoginException("Authentication failed");
        }

        NameCallback nc = new NameCallback("username: ");
        PasswordCallback pc = new PasswordCallback("password: ", false);
        try
        {
            callbackHandler.handle(new Callback[]{nc, pc});
            username = nc.getName();
            char[] tmpPassword = pc.getPassword();
            if (tmpPassword == null)
                tmpPassword = new char[0];
            password = new char[tmpPassword.length];
            System.arraycopy(tmpPassword, 0, password, 0, tmpPassword.length);
            pc.clearPassword();
        }
        catch (IOException | UnsupportedCallbackException e)
        {
            logger.info("Unexpected exception processing authentication callbacks", e);

View on GitHub (pinned to 88fd0f6a0e)