Home

Mar 21, 2013

MVC and windows authentication

I was working on MVC intranet application to display CRM data for logged in user. Everything was working as expected while running from visual studio, I have deployed the app in IIS using application pool with  specific user.

Enabled windows authentication and Asp.Net Impersonation. All set to run the application. However when I tried, it was keep redirecting me to login page with error page.

 

        

 

I checked all the setting again, no clue. Everything was looking good. After reading few post, forums, I got to know “System.Web.Helpers which is a helper that you find in WebMatrix is the culprit J.

By default it calls the SimpleMembership provider and not windows authentication in my case or any other authentication resulting in the behavior I was seeing.

Make sure your turn off the default authentication by adding following keys if you are using helper. If you can avoid using it.    

<add key="autoformsauthentication" value="false" />

<add key="enableSimpleMembership" value="false" />

 

Cheers!

Amol

No comments: