# OAuth2 错误：redirect_uri_mismatch

- **ID:** `api/oauth2-invalid-redirect-uri-mismatch`
- **领域:** api
- **类别:** auth_error
- **验证级别:** ai_generated
- **修复率:** 90%

## 根因

授权请求中的重定向 URI 与 OAuth 客户端配置中注册的 URI 不完全匹配。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| OAuth 2.0 RFC 6749 | active | — | — |
| Google OAuth 2.0 | active | — | — |
| Auth0 v3.0 | active | — | — |

## 解决方案

1. ```
   Copy the exact redirect URI from the OAuth provider's client settings page and paste it into your application code.
   ```
2. ```
   Ensure the redirect URI does not have query parameters or fragments unless explicitly allowed.
   ```

## 无效尝试

- **** — The mismatch is often a missing trailing slash or different casing; adding one may not fix if the registered URI lacks it. (50% 失败率)
- **** — Most OAuth providers do not allow wildcards for security reasons. (90% 失败率)
- **** — The error is deterministic; retrying without fixing the URI pattern will always fail. (100% 失败率)
