问题
I have an MVC5 Azure web site which was working fine last night. Now it seems to be stuck in an infinite redirect loop when trying to login via chrome. It works fine from Edge and FireFox. It uses Azure AD for authentication. The redirects are back and forth from the main site to login.microsoftonline.com.
回答1:
Sometimes, some bad tokens that AAD uses can get cached by the browser. They're used in place of the valid tokens, and not refreshed. Clearing the browser cache (Ctrl-Shift-Delete on Chrome) usually resolves this.
回答2:
I experienced this issue with one of my Azure web apps which was serving traffic over http.
The solution for me was to disable the affinity cookie.
If I had an app where maintaining user session on 1 server was required I would have to re-enable the affinity cookie, but because that caused me (intermittent) problems I would also force all traffic to https as that seems to be a more successful set up to use with the Affinity cookie.
this link was really helpful and great background info: https://azure.microsoft.com/en-us/blog/disabling-arrs-instance-affinity-in-windows-azure-web-sites/
来源:https://stackoverflow.com/questions/34169635/azure-infinite-redirect-loop-in-chrome