应用已暂停
如果您设置的 OAuth 应用已被暂停(由于被举报滥用、垃圾信息或 API 误用),GitHub 将使用以下参数重定向到已注册的回调 URL,以概述错误。
http://your-application.com/callback?error=application_suspended
&error_description=Your+application+has+been+suspended.+Contact+support@github.com.
&error_uri=/apps/building-integrations/setting-up-and-registering-oauth-apps/troubleshooting-authorization-request-errors/%23application-suspended
&state=xyz
要解决已暂停应用的问题,请通过 GitHub 支持门户 与我们联系。
重定向 URI 不匹配
如果您提供的 redirect_uri 与在应用中注册的不匹配,GitHub 将使用以下参数重定向到已注册的回调 URL,以概述错误。
http://your-application.com/callback?error=redirect_uri_mismatch
&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.
&error_uri=/apps/building-integrations/setting-up-and-registering-oauth-apps/troubleshooting-authorization-request-errors/%23redirect-uri-mismatch
&state=xyz
要纠正此错误,您可以提供与注册信息匹配的 redirect_uri,或省略此参数以使用您应用中注册的默认重定向 URI。
访问被拒绝
如果用户拒绝对您应用的访问,GitHub 将使用以下参数重定向到已注册的回调 URL,以概述错误。
http://your-application.com/callback?error=access_denied
&error_description=The+user+has+denied+your+application+access.
&error_uri=/apps/building-integrations/setting-up-and-registering-oauth-apps/troubleshooting-authorization-request-errors/%23access-denied
&state=xyz
对此您无能为力,因为用户可以自由选择不使用您的应用。大多数情况下,用户会直接关闭窗口或在浏览器中点击返回,因此您可能永远不会看到此错误。