'Azure AD authentication, 404 not found on /signin-oidc
The past few days, I have gotten a 404 error on /signin-oidc after successfully authenticated with Azure AD against my ASP.NET Core web app using the Microsoft Edge browser. This worked until recently and it still works fine in Firefox from the same PC and from Safari on mobile devices (iPhone / iPad).
This seems to be exact the same issue as described (a bit better) here: https://github.com/Azure/AKS/issues/539
So, the issue is related to running the ASP.NET application behind a Nginx ingress controller somehow. Still strange that it works in Firefox and Safari, but not in Edge and Chrome.
How can one troubleshoot this?
Solution 1:[1]
In order for ASP.NET Core to work correctly with proxy servers and load balancers some configuration is required as described in this article:
https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-6.0
This has been simplified in .net 6 and I fixed this problem today by upgrading my web application to .net 6 and setting the environment variable ASPNETCORE_FORWARDEDHEADERS_ENABLED to true when running it in a Kubernetes environment. I tested by running it in Azure Container Apps (which is built on top of Kubernetes).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | OlavT |