{"record":{"id":"00e1a39de83a4354","repo":"justauth/JustAuth","slug":"5003-00e1a3","errorCode":"5003","errorMessage":"Unsupported operation","messagePattern":"Unsupported operation","errorType":"exception","errorClass":"AuthException","httpStatus":null,"severity":"warning","filePath":"src/main/java/me/zhyd/oauth/config/AuthSource.java","lineNumber":54,"sourceCode":"     *\n     * @return url\n     */\n    String accessToken();\n\n    /**\n     * 获取用户信息的api\n     *\n     * @return url\n     */\n    String userInfo();\n\n    /**\n     * 取消授权的api\n     *\n     * @return url\n     */\n    default String revoke() {\n        throw new AuthException(AuthResponseStatus.UNSUPPORTED);\n    }\n\n    /**\n     * 刷新授权的api\n     *\n     * @return url\n     */\n    default String refresh() {\n        throw new AuthException(AuthResponseStatus.UNSUPPORTED);\n    }\n\n    /**\n     * 获取Source的字符串名字\n     *\n     * @return name\n     */\n    default String getName() {\n        if (this instanceof Enum) {","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/justauth/JustAuth/blob/694bbf1b010d93404e3bfb4824d90e9ddfaebebb/src/main/java/me/zhyd/oauth/config/AuthSource.java#L36-L72","documentation":"AuthSource.revoke() is a default interface method that throws AuthException 5003 (Unsupported operation). Any provider enum that does not override revoke() (most of them) will throw this the moment a revoke flow needs the revocation endpoint URL. It signals that the provider integration does not support token revocation, not that your code is wrong.","triggerScenarios":"Calling request.revoke(token) on a provider whose AuthDefaultSource entry does not override revoke() — e.g. DINGTALK, TAOBAO, CSDN and most others; a generic logout flow that revokes tokens for every provider.","commonSituations":"Implementing 'log out everywhere' across multiple providers where only some support revocation (e.g. Google/GitHub do, many Chinese providers do not); upgrading flows that previously ignored revoke.","solutions":["Check whether your provider's AuthDefaultSource entry overrides revoke(); if not, skip the revoke call for that provider.","If the provider has a real revocation endpoint, extend the source: create a custom AuthSource that overrides revoke() and pass it via extendSource, or override revoke() in your AuthDefaultRequest subclass.","Treat revoke as best-effort: catch AuthException with code 5003 and continue local logout."],"exampleFix":"// before\nrequest.revoke(token); // 5003 for providers without revoke()\n\n// after\ntry { request.revoke(token); }\ncatch (AuthException e) {\n    if (e.getErrcode() != AuthResponseStatus.UNSUPPORTED.getCode()) throw e;\n    // provider has no revoke endpoint; local logout only\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"boolean canRevoke(AuthSource source) {\n    // true only when the concrete enum overrides revoke(); detect via a probe\n    try { source.revoke(); return true; }\n    catch (AuthException e) { return e.getErrcode() == AuthResponseStatus.UNSUPPORTED.getCode() ? false : true; }\n}","tryCatchPattern":"try { request.revoke(token); } catch (AuthException e) { if (e.getErrcode() != AuthResponseStatus.UNSUPPORTED.getCode()) throw e; /* no revoke endpoint: local logout only */ }","preventionTips":["Treat revoke as best-effort per provider.","Maintain a capability set per source instead of probing at runtime in hot paths.","Cache the probe result per source enum."],"tags":["justauth","revoke","unsupported-operation","provider-capability"],"backgroundTag":null,"analyzedSha":"694bbf1b010d93404e3bfb4824d90e9ddfaebebb","analyzedAt":"2026-08-14T15:16:59.945Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}