来自github的授权回调URL无法正常工作,循环同一页面

问题描述 投票:0回答:1

因此,我正在建立一个网站,要求用户经过github身份验证,以便通过netify cms创建和发布博客文章。

所以在github中,我已经添加了应用程序。

主页设置为:

https://example.netlify.com  

为了到达站点的管理区域以发布博客,这样的用户必须导航到

https://example.netlify.com/admin/并通过github进行身份验证。

现在身份验证部分正在运行,我正在登录我的github帐户,但它循环返回到oauth页面,但网址很奇怪:

https://example.netlify.com/admin/?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch&state=5d971eb88a5073cf804e90d5#/collections/blog

我已将授权回调URL设置为:

https://example.netlify.com/admin/#/collections/blog

这是用户应登录的地方,以便发布博客和文章

所以为什么它不断循环?我显然设置了错误的字段,我假设我的授权回调URL不正确?

github oauth callback
1个回答
0
投票

错误= redirect_uri_mismatcherror_description =此+应用程序的+ redirect_uri +必须+匹配+已注册的回调+ URL +。error_uri = https%3A%2F%2Fdeveloper.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch

此错误消息中的主要线索是redirect_uri_mismatch,如果您接受并在Google上进行搜索,您将开始理解问题。身份服务器的安全性的一部分是Redirct uri,即身份服务器返回您的授权的重定向uri,必须在idnetiy服务器本身上注册。有人不能只代表您的应用程序发送请求,然后将授权返回到自己的网站上。

因此,您在应用程序中发送的重定向uri必须在Github上注册才能使用授权。目前没有。

您可以在Troubleshooting OAuth App access token request errors上了解更多信息>

© www.soinside.com 2019 - 2024. All rights reserved.