{"meta":{"title":"排查授权请求错误","intro":"为用户获取 OAuth 令牌时，在初始授权请求阶段可能会出现一些错误。","product":"应用","breadcrumbs":[{"href":"/zh/apps","title":"应用"},{"href":"/zh/apps/oauth-apps","title":"OAuth 应用"},{"href":"/zh/apps/oauth-apps/maintaining-oauth-apps","title":"维护 OAuth 应用"},{"href":"/zh/apps/oauth-apps/maintaining-oauth-apps/troubleshooting-authorization-request-errors","title":"故障排除授权"}],"documentType":"article"},"body":"# 排查授权请求错误\n\n为用户获取 OAuth 令牌时，在初始授权请求阶段可能会出现一些错误。\n\n## 应用程序已挂起\n\n如果你设置的 OAuth app 已挂起（由于报告的滥用、垃圾邮件或 API 使用不当），GitHub 将使用以下参数重定向到注册的回调 URL 以总结错误：\n\n    http://your-application.com/callback?error=application_suspended\n      &error_description=Your+application+has+been+suspended.+Contact+support@github.com.\n      &error_uri=/apps/building-integrations/setting-up-and-registering-oauth-apps/troubleshooting-authorization-request-errors/%23application-suspended\n      &state=xyz\n\n要解决已挂起应用程序的问题，请联系 通过网站管理员[GitHub支持门户](https://support.github.com)。\n\n## 重定向 URI 不匹配\n\n如果你提供的 `redirect_uri` 与你在应用程序中注册的 URL 不匹配，GitHub 将使用以下参数重定向到注册的回调 URL 以总结错误：\n\n    http://your-application.com/callback?error=redirect_uri_mismatch\n      &error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.\n      &error_uri=/apps/building-integrations/setting-up-and-registering-oauth-apps/troubleshooting-authorization-request-errors/%23redirect-uri-mismatch\n      &state=xyz\n\n要更正此错误，请提供一个与你注册的 URL 匹配的 `redirect_uri`，或者忽略此参数以使用在应用程序中注册的默认 URL。\n\n### 访问被拒绝\n\n如果用户拒绝访问应用程序，GitHub会重定向到已注册的回调 URL，并使用以下参数汇总错误：\n\n    http://your-application.com/callback?error=access_denied\n      &error_description=The+user+has+denied+your+application+access.\n      &error_uri=/apps/building-integrations/setting-up-and-registering-oauth-apps/troubleshooting-authorization-request-errors/%23access-denied\n      &state=xyz\n\n在这方面你无能为力，因为用户可以自由选择不使用你的应用程序。 通常，用户只是关闭窗口或在浏览器中按返回按钮，所以你可能永远不会看到此错误。"}