I try to add authentication with facebook on my react native application. I have created an application on auth0, native, and everything is configured : auth0 app, facebook, callbacks and facebook credentials.
Here is my code for authorization code :
auth0.webAuth
.authorize({
scope: Config.AUTHO_SCOPE,
prompt: “login”,
audience: Config.AUTH0_AUDIENCE,
})
.then(res => {
console.log(res);
SInfo.setItem(“accessToken”, res.accessToken, {});
SInfo.setItem(“refreshToken”, res.refreshToken, {});
auth0.auth
.userInfo({ token: res.accessToken })
.then(data => {
this.gotoAccount(data); // go to the Account screen
})
.catch(err => {
console.log("error occurred while trying to get user details: ", err);
});
})
.catch(error => {
console.log("error occurred while trying to authenticate: ", error);
});
When I try to login on iOS simulator, everything is ok, but I have an error message access_denied: Unauthorized
, and I don`t receive token.
Someone could figure it out ?