{"record":{"id":"788ae8b3e487b8e4","repo":"dromara/Sa-Token","slug":"code-30304","errorCode":"CODE_30304","errorMessage":"jwt cannot get token list","messagePattern":"jwt cannot get token list","errorType":"exception","errorClass":"ApiDisabledException","httpStatus":null,"severity":"warning","filePath":"sa-token-plugin/sa-token-temp-jwt/src/main/java/cn/dev33/satoken/temp/jwt/SaTempTemplateForJwt.java","lineNumber":73,"sourceCode":"\tpublic long getTimeout(String token) {\n\t\treturn SaJwtUtil.getTimeout(token, getJwtSecretKey());\n\t}\n\n\t/**\n\t * 删除一个token\n\t */\n\t@Override\n\tpublic void deleteToken(String token) {\n\t\tthrow new ApiDisabledException(\"jwt cannot delete token\").setCode(SaTempJwtErrorCode.CODE_30302);\n\t}\n\n\t/**\n\t * 获取指定 value 的 temp-token 列表记录\n\t * @param value /\n\t * @return /\n\t */\n\tpublic List<String> getTempTokenList(Object value) {\n\t\tthrow new ApiDisabledException(\"jwt cannot get token list\").setCode(SaTempJwtErrorCode.CODE_30304);\n\t}\n\n\t/**\n\t * 获取jwt秘钥 \n\t * @return jwt秘钥 \n\t */\n\t@Override\n\tpublic String getJwtSecretKey() {\n\t\tString jwtSecretKey = SaManager.getConfig().getJwtSecretKey();\n\t\tif(SaFoxUtil.isEmpty(jwtSecretKey)) {\n\t\t\tthrow new SaTokenException(\"请配置：jwtSecretKey\").setCode(SaTempJwtErrorCode.CODE_30301);\n\t\t}\n\t\treturn jwtSecretKey;\n\t}\n\t\n}\n","sourceCodeStart":55,"sourceCodeEnd":90,"githubUrl":"https://github.com/dromara/Sa-Token/blob/ac2c7f6e94a78573cf0bcb932dd8b04e68fad189/sa-token-plugin/sa-token-temp-jwt/src/main/java/cn/dev33/satoken/temp/jwt/SaTempTemplateForJwt.java#L55-L90","documentation":"ApiDisabledException from SaTempTemplateForJwt.getTempTokenList: listing the temp tokens issued for a value requires enumeration over stored tokens, which a stateless JWT implementation cannot provide. The API exists on the base template but is intentionally unimplemented here.","triggerScenarios":"Calling getTempTokenList(value) (directly or via admin/audit code) while the JWT temp-token template is bound as the SaTempTemplate implementation.","commonSituations":"Porting management/monitoring features that worked with the Redis-backed temp token to a deployment using sa-token-temp-jwt.","solutions":["Drop the listing feature for JWT temp tokens — track issued tokens in your own table if you need an audit trail","Switch to the storage-backed temp implementation if enumeration is a firm requirement"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"boolean supportsListing = !(SaManager.getSaTempTemplate() instanceof SaTempTemplateForJwt);","tryCatchPattern":"try { temp.getTempTokenList(v); } catch (ApiDisabledException e) { /* listing unsupported for jwt: skip feature */ }","preventionTips":["Gate admin/enumeration features on the concrete temp template in use","Maintain your own issuance ledger if token listing is required"],"tags":["sa-token","jwt","api-disabled","stateless"],"backgroundTag":null,"analyzedSha":"ac2c7f6e94a78573cf0bcb932dd8b04e68fad189","analyzedAt":"2026-08-14T14:36:10.271Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}