Login to ADFS without prompting for credentials

adfsasp.netauthentication

I've set up a site using ASP.NET MVC 5 to use claims based security using our on premise ADFS server. The site performs the redirect to the ADFS server which asks for the users AD credentials to log in, and then redirects back to my site. At that point the user is authenticated and I have access to all the claims that ADFS is sending.

The issue is I don't my users to have to enter their credentials. I would assume their windows credentials could be sent to the server to make the sign in process seamless but I can't figure out how. I have attempted to set the authentication mode to windows but it has no effect.

Both the ADFS and my site are internal and the ADFS site appears in my Local Intranet Sites settings. I've tested with both IE9 & Chrome and they both have pop up a dialog box looking for credentials. I've spoken with the sysadmin and windows authentication is enabled for ADFS.

How can I authenticate with ADFS without my users being prompted for their credentials?

Best Answer

I encountered the same issue as well and finally figured out the cause. This may occur if the ADFS authentication page url is a non-intranet address.

To resolve the issue, change the wsfederation issuer address in application's web.config to one that would be treated by the browser as an intranet address.

Change the following

<wsFederation passiveRedirectEnabled="true" issuer="https://xyz.abc.com/adfs/ls/" realm="http://myapps/MVCpluADFS" requireHttps="true" />

to

<wsFederation passiveRedirectEnabled="true" issuer="https://xyz/adfs/ls/" realm="http://myapps/MVCpluADFS" requireHttps="true" />

where xyz is the machine name where ADFS is installed.

Do not change the adfs trust urls though. Keep them as they are since they would be used for matching and establishing trust between your application and ADFS.

The browser treats "xyz.abc.com" as an internet address, and hence displays a login prompt while "xyz" is treated as an intranet address so it automatically forwards logged in user credentials to the application without the user having to specify credentials himself/herself.

After this change, any intranet user would be directly logged in to the application if the browser used is Internet Explorer with default security settings (i.e. "Automatic logon only in Intranet zone" under Security tab -> Internet -> Custom level) or Chrome (since it picks up the settings set for Internet Explorer).

To make the automatic login work in Firefox, the following additional steps would have to be performed:

1) Type about:config into the firefox address bar. You might be warned about editing this section, go ahead anyway.

2) Type "fqdn" in the search bar. You should now see 2 settings i.e. "network.automatic-ntlm-auth.allow-non-fqdn" and "network.negotiate-auth.allow-non-fqdn". Change the values of both to true.

Related Topic