api
auth_error
ai_generated
true
OAuth2 错误:redirect_uri_mismatch
OAuth2 error: redirect_uri_mismatch
ID: api/oauth2-invalid-redirect-uri-mismatch
90%修复率
88%置信度
1证据数
2023-06-15首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| OAuth 2.0 RFC 6749 | active | — | — | — |
| Google OAuth 2.0 | active | — | — | — |
| Auth0 v3.0 | active | — | — | — |
根因分析
授权请求中的重定向 URI 与 OAuth 客户端配置中注册的 URI 不完全匹配。
English
The redirect URI in the authorization request does not exactly match one registered in the OAuth client configuration.
官方文档
https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2解决方案
-
Copy the exact redirect URI from the OAuth provider's client settings page and paste it into your application code.
-
Ensure the redirect URI does not have query parameters or fragments unless explicitly allowed.
无效尝试
常见但无效的做法:
-
50% 失败
The mismatch is often a missing trailing slash or different casing; adding one may not fix if the registered URI lacks it.
-
90% 失败
Most OAuth providers do not allow wildcards for security reasons.
-
100% 失败
The error is deterministic; retrying without fixing the URI pattern will always fail.