【问题标题】:Retrieve id token after authentication with Auth0's Lock使用 Auth0 的 Lock 进行身份验证后检索 id 令牌
【发布时间】:2019-12-14 05:31:55
【问题描述】:

我正在使用 Auth0 的 Lock 小部件让用户通过身份验证。

完成后如何获得idToken

【问题讨论】:

    标签: auth0 auth0-lock


    【解决方案1】:

    如果您的锁定选项在auth.responseType 选项中指定id_token,则idTokenauthenticated 事件上可用的authResult 参数内:

    var lock = new Auth0Lock(
              '<your-client-id>',
              '<your-auth0-domain>',
              {
                  auth: {
                      responseType: 'token id_token',
                  },
                  container: 'lockRoot'
              }
        );
    lock.on("authenticated", function(authResult) {
          console.log('id token: ' + authResult.idToken);
    }
    

    【讨论】:

      猜你喜欢
      • 2017-04-11
      • 1970-01-01
      • 1970-01-01
      • 2017-12-14
      • 2020-03-06
      • 2019-06-28
      • 1970-01-01
      • 2021-07-17
      • 1970-01-01
      相关资源
      最近更新 更多