Sitecore.Context becomes null when auth0 is used for authentication

Hi Support Team,

We are currently implementing auth0(https://auth0.com/) in our application(.net MVC) for authentication. We are facing an issue post implementation where Sitecore Context(Sitecore.Context) becomes null during redirection anywhere intermediate. After receiving response from Auth0 in our application for user authentication, we are initializing the Sitecore context and post initialization we have verified that it has valid data. As the login process is over and the request is redirected to our landing page, we found that Sitecore Context becomes null between this redirection.We checked it the other way by getting logged in normally i.e. without Auth0 and it is working fine. Just wanted to know if there is any configuration level change require. Moreover, I request you to share any documentation or case study related to integration of Auth0 with .net (MVC) application with sitecore.
Note: We are using Auth0 to authenticate user to our MVC Application and not Sitecore.

Hi @ggandhi,

I am not able to find any previous instances of this specific issue or any docs with sitecore. Can you please provide me with a trace of your issue via DM?

I am not finding much information on sitecore internally.

Thanks,
Dan

Hi Dan,

Thank you for quick response. Please find following attached files:

  1. portal_auth0.har → .net Application with Auth0 integration
  2. Portal_LoginResponse.har → .net Application without Auth0 integration

Okay you are getting the token response successfully. So it sounds like it is not being handled correctly in your application. Can you post the code associated with storing/persisting the token?

Thanks,
Dan

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.