获取 401 未经授权:身份验证失败:无法在 okta web 应用程序中获取访问令牌

Getting 401 unauthorized : Authentication Failed: Could not obtain access token in okta web app

我创建了一个 jhipster 单体应用程序(jhipster 版本 v4.14.2)。我还使用以下设置创建了一个 Okta Web 应用程序:

我更新了我的 jhipster 应用程序的 application.yaml 如下:

security:
    basic:
        enabled: false
    oauth2:
        client:
            access-token-uri: https://dev-779125.oktapreview.com/oauth2/default/v1/token
            user-authorization-uri: https://dev-779125.oktapreview.com/oauth2/default/v1/authorize
            client-id: ????????
            client-secret: ????????
            client-authentication-scheme: form
            scope: openid profile email
        resource:
            filter-order: 3
            user-info-uri: https://dev-779125.oktapreview.com/oauth2/default/v1/userinfo
            token-info-uri: https://dev-779125.oktapreview.com/oauth2/default/v1/introspect
            prefer-token-info: false

当我启动应用程序然后尝试登录时。我确实看到了 Okta 登录页面,但是在添加我的凭据后我总是收到以下错误:

Your request cannot be processed
Sorry, an error has occurred.

Status: Unauthorized (Unauthorized)
Message: Authentication Failed: Could not obtain access token

我按照 jhipster 安全文档中的说明进行操作,但无法正常工作。知道为什么我仍然收到未经授权的错误吗?

这可能与jhipster无关。确保您 URL 访问访问令牌是正确的。

您使用的是哪种授权类型?

https://developer.okta.com/authentication-guide/implementing-authentication/

我认为错误在这里:

访问令牌-uri:https://dev-779125.oktapreview.com/oauth2/default/v1/token 用户授权 uri:https://dev-779125.oktapreview.com/oauth2/default/v1/authorize

"user-authorization-uri" 是 jhipster 请求 "issuer URL" 的方式吗?