We are unable to get logins to work using Safari cross site tracking enabled (ITP). Event after setting up a custom domain for auth Safari still doesn’t work. PLEASE HELP.
React 18.2 SPA website
using Auth0 react 2.2.0
What further information can we supply which will assist?
Are you able to elaborate on what you mean by logins not working? Where exactly is the login flow breaking down? Are there any errors or additional context you can share? The more detailed information you can provide the better!
I’d be super-happy to. Here is the success code. When using Safari the user variable doesn’t get a value from useAuth0(). When other browsers are used all works as expected. GET_USER is a GraphQL query statement.
I have been attempting to reproduce on my end using our React sample app and have up to this point not been able to reproduce what you are seeing in Safari.
In particular, using default settings in Safari (prevent cross-site tracking on) I am logging a user in and getting a valid user from useAuth0() here:
Auth0Provider is initialized here and App component and subsequently Router can be found here.
Would you be willing to configure the sample app to your environment and test that way? I’m just curious if you experience the same issue with the stripped down sample app.
I am on vacation next week so trying this out will be delayed. I honestly didn’t think it would a few days to get a response (this is my second post on this issue trying to get a response).
Does the onRedirectCallback need to defined? We are not using this property at all. It doesn’t seem like something that would affect the login as well.
The other part which is confusing me about the simple example app is that refresh tokens are not enabled. I also don’t see a scope being defined in the client. So a few differences noted right off the bat.
If we have useRefreshTokens={false} and no localstorage (which is how the example is set), the login works, but only with ITP disabled (or shields down).
How will some of these initially pointed out discrepancies affect things?
Hey @brettski thanks for getting back to me! I apologize for the delayed response. We try our best to get to everyone and everything here but even then we aren’t able to
onRedirectCallback is not required.
My bad! You will need to set both in order to test properly.
I’ve tested with both useRefreshTokens set to false and true - I am able to log in using both Brave and Safari successfully. When my access token is expired and the SDK goes to perform silent auth without a refresh token it fails in both browsers and user interaction is required. However, with a refresh token there is a successful refresh token exchange in my tenant logs which is the expected behavior.
@tyf While I was on vacation a person on my team determined there was delay in getting things back initially. The code below shows the addition of a custom component <AuthWrapper>, which is detailed below. This hack has corrected the login issue while refresh tokens are enabled. Which as I mentioned was causing me issues when testing things out.