Auth0 Home Blog Docs

Receiving a forbidden error message on Azure during Auth0 callback

This isn’t a question, but an answer for anyone who struggles like I did. So, if it helps even a single person, it was worth the post :slight_smile:

I have an ASP.NET Core 2 app that I was integrating Auth0 into. My development environment worked fine, everything was good. Wanted to push to my staging environment. However, immediately after Auth0 sign-in, it would post to the /callback Url and I would get “You do not have permissions to view this directory or page.”

Scouring the internet left me empty handed, logs were useless.

Solution: I had turned Authorization on in Azure in my Staging environment using AAD. Meaning, to access my staging environment, one had to be logged in with an account from my directory, which happens to be my Microsoft account which is always logged in. Both the Azure authorization and the Auth0 authorization were conflicting somehow. Turning that off in Azure everything works as expected. :man_facepalming:

I hope this helps someone out :slight_smile:

2 Likes

Thanks for sharing it with the community! I’m sure it will help somebody at some point.

I’ll repaste it to another message and mark it as solve cause we cannot mark first message as a solution. Thanks a lot for that @rev23dev !

This isn’t a question, but an answer for anyone who struggles like I did. So, if it helps even a single person, it was worth the post :slight_smile:

I have an ASP.NET Core 2 app that I was integrating Auth0 into. My development environment worked fine, everything was good. Wanted to push to my staging environment. However, immediately after Auth0 sign-in, it would post to the /callback Url and I would get “You do not have permissions to view this directory or page.”

Scouring the internet left me empty handed, logs were useless.

Solution: I had turned Authorization on in Azure in my Staging environment using AAD. Meaning, to access my staging environment, one had to be logged in with an account from my directory, which happens to be my Microsoft account which is always logged in. Both the Azure authorization and the Auth0 authorization were conflicting somehow. Turning that off in Azure everything works as expected. :man_facepalming:

I hope this helps someone out :slight_smile:

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