'Azure AD authentication: Blazor server app returns error 50196 when published to AD

I have a problem, on my local machine i am able to authenticate, applied token cache, etc.

When I deploy to Azure I get a "We couldn't sign you in. Please try again.", and the details: Error Code: 50196, which is a 'LoopDetected' issue.

Already checked the RedirectURI configured in the app matches the one in the appsettings.

My program.cs looks like this: enter image description here

And my Auth service:

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source