将auth0从v7迁移到v9

时间:2018-03-20 08:12:06

标签: reactjs migration auth0

我正在从Auth0的v7迁移到v9,我没有使用旧版本的redirectUri。

我有这个登录代码:

const auth0 = new Auth0({
   clientID: CLIENT_ID,
   domain: CLIENT_DOMAIN,
   responseType: 'token'
 });

 withPromise(auth0.login.bind(auth0), {
    connection: 'db',
    sso: false,
    responseType: 'token'
    username: authCreds.email.trim(),
    password: authCreds.password.trim()
 });

我将其重写为:

const webAuth = new Auth0.WebAuth({
  clientID: CLIENT_ID,
  domain: CLIENT_DOMAIN,
  responseType: 'token id_token',
  redirectUri: ''
});

withPromise(webAuth.login.bind(webAuth), {
    realm: 'db',
    username: authCreds.email.trim(),
    password: authCreds.password.trim(),
    sso: false,
    redirect: false
  });

但现在登录后,它会重定向到https://include-staging.auth0.com/authorize?client_id= ...

有错误:

Oops!, something went wrong
server_error: Unable to issue redirect for OAuth 2.0 transaction

我不需要使用回调

1 个答案:

答案 0 :(得分:1)

他们写了guide for migrating from v7 to v9.

就个人而言,我非常沮丧。似乎他们的服务设计很差,现在客户付出了代价。