{"record":{"id":"96691cd6d805fcfb","repo":"apereo/cas","slug":"throwable-getmessage","errorCode":null,"errorMessage":"throwable.getMessage()","messagePattern":"throwable\\.getMessage\\(\\)","errorType":"exception","errorClass":"FailedLoginException","httpStatus":null,"severity":"error","filePath":"core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/handler/support/jaas/AccountsPreDefinedLoginModule.java","lineNumber":53,"sourceCode":"        val providedAccounts = options.containsKey(\"accounts\") ? options.get(\"accounts\").toString() : null;\n        if (StringUtils.isNotBlank(providedAccounts)) {\n            val eachAccount = org.springframework.util.StringUtils.commaDelimitedListToSet(providedAccounts);\n            eachAccount.stream()\n                .map(account -> Splitter.on(\"::\").splitToList(account))\n                .filter(results -> results.size() == 2)\n                .forEach(results -> accounts.put(results.getFirst(), results.get(1)));\n        }\n    }\n\n    @Override\n    public boolean login() throws LoginException {\n        val nameCallback = new NameCallback(\"username\");\n        val passwordCallback = new PasswordCallback(\"password\", false);\n\n        FunctionUtils.doAndHandle(_ -> {\n            callbackHandler.handle(new Callback[]{nameCallback, passwordCallback});\n        }, throwable -> {\n            throw new FailedLoginException(throwable.getMessage());\n        }).accept(nameCallback);\n\n        val username = nameCallback.getName();\n        if (accounts.containsKey(username)) {\n            val password = new String(passwordCallback.getPassword());\n            this.succeeded = accounts.get(username).equals(password);\n            subject.getPrincipals().add(new StaticPrincipal(username));\n            return true;\n        }\n        this.succeeded = false;\n        return false;\n    }\n\n    @Override\n    public boolean commit() {\n        return this.succeeded;\n    }\n","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/handler/support/jaas/AccountsPreDefinedLoginModule.java#L35-L71","documentation":"The predefined-accounts JAAS login module wraps any failure of callbackHandler.handle() (which collects the username/password callbacks) into a FailedLoginException whose message is the underlying throwable's message. It fires when the callback handler cannot supply credentials — typically no NameCallback/PasswordCallback handler is wired or the caller aborted. The username/password then cannot be checked against the configured 'accounts' option.","triggerScenarios":"Thrown at core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/handler/support/jaas/AccountsPreDefinedLoginModule.java:53 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure a callback handler able to supply name/password callbacks is configured for this JAAS login module","Check the underlying throwable message for the actual callback failure cause","Verify the 'accounts' JAAS option format is account::password entries separated by commas"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}