{"record":{"id":"66905b2c3d927ba8","repo":"apereo/cas","slug":"unable-to-find-account-the-account-does-not","errorCode":null,"errorMessage":"Unable to find account [{}]: The account does not exist or it's missing username/password attributes","messagePattern":"Unable to find account \\[(.+?)\\]: The account does not exist or it's missing username/password attributes","errorType":"exception","errorClass":"AccountNotFoundException","httpStatus":null,"severity":"error","filePath":"support/cas-server-support-cassandra-authentication/src/main/java/org/apereo/cas/authentication/CassandraAuthenticationHandler.java","lineNumber":42,"sourceCode":"    public CassandraAuthenticationHandler(final String name,\n                                          final PrincipalFactory principalFactory, final Integer order,\n                                          final CassandraAuthenticationProperties cassandraAuthenticationProperties,\n                                          final CassandraRepository cassandraRepository) {\n        super(name, principalFactory, order);\n        this.cassandraAuthenticationProperties = cassandraAuthenticationProperties;\n        this.cassandraRepository = cassandraRepository;\n    }\n\n    @Override\n    protected AuthenticationHandlerExecutionResult authenticateUsernamePasswordInternal(final UsernamePasswordCredential credential,\n                                                                                        @Nullable final String originalPassword) throws Throwable {\n        val username = credential.getUsername();\n        val attributes = this.cassandraRepository.getUser(username);\n\n        if (attributes == null || attributes.isEmpty()\n            || !attributes.containsKey(cassandraAuthenticationProperties.getUsernameAttribute())\n            || !attributes.containsKey(cassandraAuthenticationProperties.getPasswordAttribute())) {\n            LOGGER.warn(\"Unable to find account [{}]: The account does not exist or it's missing username/password attributes\", username);\n            throw new AccountNotFoundException();\n        }\n\n        LOGGER.debug(\"Located account attributes [{}] for [{}]\", attributes.keySet(), username);\n        val entryPassword = attributes.get(cassandraAuthenticationProperties.getPasswordAttribute()).getFirst().toString();\n\n        if (!getPasswordEncoder().matches(originalPassword, entryPassword)) {\n            LOGGER.warn(\"Account password on record for [{}] does not match the given password\", username);\n            throw new FailedLoginException();\n        }\n        val principal = this.principalFactory.createPrincipal(username, attributes);\n        return createHandlerResult(credential, principal, new ArrayList<>());\n    }\n}\n","sourceCodeStart":24,"sourceCodeEnd":57,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/support/cas-server-support-cassandra-authentication/src/main/java/org/apereo/cas/authentication/CassandraAuthenticationHandler.java#L24-L57","documentation":"CassandraAuthenticationHandler logs this warning when it cannot authenticate because no usable user record was found: the repository returned null/empty attributes, or the attribute map lacks the configured username or password attribute. It then throws AccountNotFoundException so the credential is treated as unknown-user, not bad-password.","triggerScenarios":"authenticateUsernamePasswordInternal calls cassandraRepository.getUser(username); the resulting map is null/empty or missing cassandra.authn.username-attribute / password-attribute keys, triggering AccountNotFoundException.","commonSituations":"Wrong keyspace/table or replica set configured so the user row does not exist; case-mismatched usernames (Cassandra keys are case-sensitive); custom column names not reflected in username-attribute/password-attribute settings; user simply not provisioned.","solutions":["Verify the account row exists in the configured keyspace/table (e.g. SELECT * FROM users WHERE username='...').","Check cas.authn.cassandra[0].username-attribute and password-attribute match the actual column names in the table.","Confirm keyspace/contact-point configuration points at the intended Cassandra cluster.","Normalize username case (or lower-case the stored value) to avoid case-sensitivity misses."],"exampleFix":"// before\ncas.authn.cassandra[0].username-attribute=login\ncas.authn.cassandra[0].password-attribute=secret\n// after (matching actual table columns)\ncas.authn.cassandra[0].username-attribute=username\ncas.authn.cassandra[0].password-attribute=password","handlingStrategy":"try-catch","validationCode":"// before authenticating, verify the account row exists\nResultSet rs = session.execute(\"SELECT \" + usernameAttr + \", \" + passwordAttr +\n  \" FROM users WHERE \" + usernameAttr + \" = ?\", username);\nif (rs.one() == null) throw new AccountNotFoundException(username);","typeGuard":"function isValidAccount(attrs: Record<string, string[]> | null, u: string, p: string): attrs is Record<string, string[]> {\n  return !!attrs && u in attrs && p in attrs && attrs[p].length > 0;\n}","tryCatchPattern":"try {\n  return cassandraHandler.authenticate(credential);\n} catch (AccountNotFoundException e) {\n  LOGGER.warn(\"Unknown user [{}] in Cassandra\", credential.getUsername());\n  return AuthenticationHandlerResult.failed(credential, e);\n}","preventionTips":["Validate username-attribute/password-attribute settings against the real table schema.","Seed and verify test accounts in the configured keyspace before rollout.","Normalize username case at ingestion and lookup.","Confirm contact points and keyspace point to the intended Cassandra environment."],"tags":["cassandra","authentication","account-not-found"],"backgroundTag":"user-not-found","analyzedSha":"e7288fc434b4f4505b8452e1a57e8fb3111bb863","analyzedAt":"2026-09-08T15:39:16.015Z","contentChangedAt":"2026-09-08T15:39:16.015Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}