I am going mad and would like to get some help from someone.
I have even now tried with the sample app but am guetting the same result.
In a nutshell: When calling authorize in my react-native app, I never get a token back
This is the login implementation, where I just added a few more debug lines
const onLogin = async () => {
try {
console.log("Starting authorization...");
await authorize({ scope: "openid profile email offline_access", audience: "https://localhost/api" });
console.log("Authorization completed.");
let credentials = await getCredentials();
setToken(credentials.accessToken);
console.log('AccessToken: ' + credentials.accessToken);
} catch (e) {
console.log("Error:", e);
}
};
When running the app, here is what happens, in that order
- console prints
Starting authorization… - I am getting a login screen for my application, where I enter my credentials
- console prints
Navigated to https:///u/login?state=hKFo2SBhX0lObTEzSFpjSUhCamN3Y0Jha2MtXzJFSVZGQVh4TqFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIFZOeEp5TVBzdXJWd2JSMmphSG9HaEhzU2Q4Z29NYWVDo2NpZNkgdXprZU9Ia1ZibDVmSkZuY1ZablRQMnM1d2I3eVhiY3Y - logs in auth0 show me
Successful login - logs in auth0 show me
Authorization Code for Access Token - with this I can now look at the
userobject, that is populated, the app tells me I am logged in and shows me my email - from here on, nothing happens. no token ever gets printed
Environment details:
- node v22.21.1
- npx version 10.9.4
- package.json is left as is, so I am on
“react-native-auth0”: “^5.0.0-beta.1”, but I also tried with5.3.1(which is what my actual app is running on) - running inside a devcontainer
This is probably some stupid mistake, but I dont understand whats happening
Do I need to implement my own logic for getting from authorization token to jwt token?
— edit:1
Mayb I should add that the authentication is successful with the same settings in my API client Bruno. So I think its not a problem with my auth0 app setup
— edit: 2
Okay so it seems when building the android app, it works
So am I just stupid and I can not use auth0 with the browser?
— edit: 3
Okay I guess I answered my own question, we can delete this or keep it here for the hall of shame:
There is react-native and react packages. To use an app in the web and on phones, I guess one has to implement both