Hi everyone.
In my Auth0 tenant I have 2 apps: a Regular Web App and a Native App.
Regular Web app refers to a NextJS app (frontend + API backend);
while my Native App refers to an Android App I am working on.
My native app will have to connect with the Nexjts API backend, where the various endpoints are protected by Auth0.
So, what I want to achieve is:
I log in to my native app;
I retrieve the access token;
I use access token as Bearer Token to authenticate to my NextJS App.
So, briefly my question is: is it possible to share a session between 2 Auth0 apps?
If you are using an Auth0 SDK which utilizes a browser based login flow (Chrome Custom Tabs) and Chrome on the device to access the web app along with silent authentication you should get what you are looking for. Here’s an example of silent auth in nextjs:
As regard silent authentication, I can retrieve a token in my Native App by consuming getAccessTokenSilently function from auth0/auth0-react library.
I already tried to use this token to authenticate to my Regular Web App APIs, but I get an error warning me that the format is incorrect (as I expected).
If I understand correctly, should I be able to do this by enabling SSO within my tenant?