justauth/JustAuth · warning · AuthException
5003
5003
Error message
Unsupported operation
What it means
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.
Source
Thrown at src/main/java/me/zhyd/oauth/config/AuthSource.java:54
*
* @return url
*/
String accessToken();
/**
* 获取用户信息的api
*
* @return url
*/
String userInfo();
/**
* 取消授权的api
*
* @return url
*/
default String revoke() {
throw new AuthException(AuthResponseStatus.UNSUPPORTED);
}
/**
* 刷新授权的api
*
* @return url
*/
default String refresh() {
throw new AuthException(AuthResponseStatus.UNSUPPORTED);
}
/**
* 获取Source的字符串名字
*
* @return name
*/
default String getName() {
if (this instanceof Enum) {View on GitHub (pinned to 694bbf1b01)
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.
Example fix
// before
request.revoke(token); // 5003 for providers without revoke()
// after
try { request.revoke(token); }
catch (AuthException e) {
if (e.getErrcode() != AuthResponseStatus.UNSUPPORTED.getCode()) throw e;
// provider has no revoke endpoint; local logout only
} Defensive patterns
Strategy: type-guard
Type guard
boolean canRevoke(AuthSource source) {
// true only when the concrete enum overrides revoke(); detect via a probe
try { source.revoke(); return true; }
catch (AuthException e) { return e.getErrcode() == AuthResponseStatus.UNSUPPORTED.getCode() ? false : true; }
} Try / catch
try { request.revoke(token); } catch (AuthException e) { if (e.getErrcode() != AuthResponseStatus.UNSUPPORTED.getCode()) throw e; /* no revoke endpoint: local logout only */ } Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- 5003
- 不支持获取授权 url,请使用小程序内置函数 wx.login() 登录获取 code
- 不支持获取用户信息 url,请使用小程序内置函数 wx.getUserProfile() 获取用户信息
- 不支持获取授权 url,请使用小程序内置函数 qq.login() 登录获取 code
- 不支持获取用户信息 url,请使用小程序内置函数 qq.getUserInfo() 获取用户信息
AI-assisted analysis of justauth/JustAuth@694bbf1b01 (2026-08-14).
Data as JSON: /api/errors/00e1a39de83a4354.
Report an issue: GitHub.