【发布时间】:2018-03-02 05:40:00
【问题描述】:
我正在使用 react-native-auth0 sdk。这是我使用 auth0 进行 facebook 登录的方法。
auth0
.webAuth
.authorize({
scope: 'openid profile email offline_access',
//audience: config.auth0.audience, //option (1)
audience: auth0Domain+'/userinfo', //option (2)
responseType: 'token id_token',
})
.then(auth0Cred => {
console.log("Auth0 Auth Result: "+JSON.stringify(auth0Cred));
dispatch(signInAuth0Successful(auth0Cred));
if (callback != null) {
callback(auth0Cred);
}
dispatch(saveAuth0RefreshToken(auth0Cred.refreshToken));
//return auth0Cred;
})
.catch(error => console.log(error));
对于观众,我有两种选择。
当我使用选项 (1) 时,它给了我 accessToken、idToken、scope、expiresIn、tokenType 的(长版本)。
当我使用选项 (2) 时,它给了我 accessToken、idToken、refreshToken、expiresIn、tokenType 的(不透明版本)。
但是,我同时需要长 accessToken 和 refreshToken 吗?有可能吗?
【问题讨论】:
标签: react-native auth0