{"record":{"id":"ac8e157eb2a6626c","repo":"jwtk/jjwt","slug":"unsupported-signature-algorithm-value","errorCode":null,"errorMessage":"Unsupported signature algorithm '${value}'","messagePattern":"Unsupported signature algorithm '(.+?)'","errorType":"exception","errorClass":"SignatureException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/io/jsonwebtoken/SignatureAlgorithm.java","lineNumber":670,"sourceCode":"\n    /**\n     * Looks up and returns the corresponding {@code SignatureAlgorithm} enum instance based on a\n     * case-<em>insensitive</em> name comparison.\n     *\n     * @param value The case-insensitive name of the {@code SignatureAlgorithm} instance to return\n     * @return the corresponding {@code SignatureAlgorithm} enum instance based on a\n     * case-<em>insensitive</em> name comparison.\n     * @throws SignatureException if the specified value does not match any {@code SignatureAlgorithm}\n     *                            name.\n     */\n    public static SignatureAlgorithm forName(String value) throws SignatureException {\n        for (SignatureAlgorithm alg : values()) {\n            if (alg.getValue().equalsIgnoreCase(value)) {\n                return alg;\n            }\n        }\n\n        throw new SignatureException(\"Unsupported signature algorithm '\" + value + \"'\");\n    }\n}\n","sourceCodeStart":652,"sourceCodeEnd":673,"githubUrl":"https://github.com/jwtk/jjwt/blob/fb71496164c71442d08adec4571d9616ed5e1b8d/api/src/main/java/io/jsonwebtoken/SignatureAlgorithm.java#L652-L673","documentation":"Lookup-failure guard in SignatureAlgorithm.forName(String): the method scans the enum's values using a case-insensitive name comparison, and if the supplied string does not equal any algorithm name (HS256, HS384, HS512, RS256, RS384, RS512, PS256, PS384, PS512, ES256, ES384, ES512, NONE), a SignatureException is thrown. The input at fault is the unrecognized alg header value — often a typo or an algorithm the application does not support.","triggerScenarios":"Thrown at api/src/main/java/io/jsonwebtoken/SignatureAlgorithm.java:670 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid algorithm name: HS256/HS384/HS512, RS256/RS384/RS512, PS256/PS384/PS512, ES256/ES384/ES512, or NONE (case-insensitive).","Trim/normalize the incoming string and check for typos before calling forName.","Catch SignatureException and reject the token/record with a clear 'unsupported algorithm' error at the application boundary."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fb71496164c71442d08adec4571d9616ed5e1b8d","analyzedAt":"2026-09-09T00:33:09.982Z","contentChangedAt":"2026-09-09T00:33:09.982Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}