ADFSv2.1 with aspnet mvc 5 redirect loop

1.2k Views Asked by At

I'm setting up a development environment to test out the ADFS login mechanism.

I have access to the admin of the ADFS server, and to my knoledge, everything is correctly configured (of course, my knoledge in the subject is very limited).

When I create a new mvc5 web site, I point the metadata URL and the identifier and everything gets generated correclty, but when I launch the site, after entering valid credentials, the browser enters in a 302 redirect loop.

I already did extensive searches on the interweb for solutions and guidance, but the server setup seems ok and I don't touch anything that the mvc project wizard generates for me.

My MVC5 Site is created with this options: http://www.asp.net/visual-studio/overview/2013/creating-web-projects-in-visual-studio#orgauthonprem

And for the server configuration, I'm following this guide: http://www.syfuhs.net/post/2010/08/13/Installing-ADFS-2-and-Federating-an-Application.aspx up until the part when they create the web site, of course.

Any help will be appreciated

NOTE: Using ADFS v2.1 on Server 2012

2

There are 2 best solutions below

4
rbrayb On

Is this the "MSIS7042: The same client browser session has made '6' requests in the last '1' seconds" error?

If so, does the endpoint of the RP that you configured in ADFS have a trailing / ?

e.g.

https://xxx/yyy/
0
MvdD On

I ran into the same issue when trying to do SAMLP authentication with ADFS. In my case, the redirect loop was caused the Extended Protection feature in ADFS and Fiddler running in the background.

The solution is to configure Fiddler to authenticate on the client's behalf as described by Eric Lawrence here.

You can also turn off Extended Protection in ADFS:

Set-ADFSProperties -ExtendedProtectionTokenCheck None