【发布时间】:2022-06-11 02:01:06
【问题描述】:
我们正在尝试使用 auth0 进行 spring-boot 应用程序身份验证。 在 auth0.com 中创建常规 Web 应用程序和机器对机器应用程序,并在用户管理下添加用户。 目的是有一个登录API来验证用户并在成功验证后获取访问令牌。使用访问令牌(作为承载令牌)访问spring-boot应用程序的其他API。
我们在 auth0.com 的机器对机器应用程序配置下提供了正确的登录和回调 url。
在生成不记名令牌时,除了 client_id、client_secret 我们还提供了 grant_type (as client_credentials)、audience > 作为 https:///api/v2 和 scope 与(openid profile my_scope 电子邮件角色)。
使用 client_id、client_secret、grant_type 和 Audience 生成的不记名令牌访问其他 API 时,我们遇到 401 错误。
其中,我们在使用 client_id、client_secret、grant_type、audience 和 scope 生成的不记名令牌访问其他 API 时遇到 403 错误。
403错误堆栈如下
Client is not authorized to access <<application-domain-in-auth0>>/api/v2/. You need to create a client-grant associated to this API.
我们提到了 udemy 会话 (https://www.udemy.com/course/build-secure-apis-with-auth0-and-postman/learn/lecture/12716335#overview)
关于整体方法以及我们哪里出错的任何意见。
谢谢
文卡塔马杜
【问题讨论】:
标签: spring-boot auth0