且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 Auth0 登录成功,但仍返回 401“访问被拒绝"?

更新时间:2023-12-03 20:26:40

我遇到了这个问题,终于找到了这个问题的原因.我在寻找问题的解决方案时遇到了这个问题,但没有得到解答.由于我能够解决这个问题,所以我决定回答这个问题.

I had this issue and was finally able to find out the cause of this issue. I came across this question while I was searching for the solution to the problem but it hadn't been answered. As I was able to solve the problem, so I decided to answer this question.

在我的例子中,问题是令牌端点返回 401 的状态代码,带有 unauthorized/access denied 错误,这似乎也是你的问题.

In my case, the problem was that token endpoint was returning status code of 401 with unauthorized/access denied error and this seems to be the problem in your case too.

问题是由于应用程序设置中令牌端点身份验证方法"的值不正确.

Problem was because of the incorrect value of "Token Endpoint Authentication Method" in the application settings.

在单页应用程序的情况下,它的值应该是None",但它被错误地设置为POST".

In case of single page application, its value should be "None" but it was incorrectly set to "POST".

似乎我们无法更改它的值,所以我刚刚创建了一个新应用程序并选择了单页 Web 应用程序" 作为应用程序类型.这解决了问题.

It seems that we cannot change its value, so i just created a new application and selected "Single Page Web Applications" as the application type. This solved the issue.