【问题标题】:When using auth0, I cannot gain access to the scope read:current_user使用 auth0 时,我无法访问范围 read:current_user
【发布时间】:2018-09-27 04:27:40
【问题描述】:

我希望能够从单页应用程序中查看和更新​​用户的元数据,但每当我尝试访问文档中可能出现的任何范围时 (https://auth0.com/docs/libraries/auth0js/v9)

但是,当我运行以下代码时:

webAuth.checkSession(
  {
    audience: `https://mysite.eu.auth0.com/api/v2/`,
    scope: "read:current_user"
  },
  (err, result) => {
    err && console.log("err", err");
    result && console.log("result", result);
  }
);

我收到以下错误:

{error: "consent_required", error_description: "Consent required"}

我尝试将范围 read:current_user 放在多个位置,但似乎总是失败。

【问题讨论】:

    标签: javascript auth0


    【解决方案1】:

    该错误表示服务器正在向用户请求额外的同意,因此checkSession 无法完成该操作,因为它静默发生,无法提示用户。

    要解决此问题,请转到 Auth0 仪表板 -> API -> Auth0 Management API -> 设置选项卡 -> 取消选中“允许跳过用户同意”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-04-20
      • 2023-04-09
      • 1970-01-01
      • 2022-07-05
      • 1970-01-01
      • 2014-01-27
      • 1970-01-01
      相关资源
      最近更新 更多