1

Im using sp2013,farm solution, claims based authentication with only windows authentication.

Backgroud: Sometimes when a user´s password expires in AD its impossible for user to know what the problem is, which cause unnessessary cases to our helpdesk

Suggested solution for this problem is to use forms authentication and a custom mmebership provider (like this tutorial), but instead using a ActiveDirectoryMembershipProvider. But all of these tutorials ends up having a dropdown where user have to choose between windows- and forms based authentication. My users doesnt have a clue what this means and they have to do an extra step every time they login.

So...Is there any way I can use windows authentication as default(which is used 99% of the times) and if user gets any error from this (like access denied), he will be redirected to the forms authentication page? For example by using a http module.

1

I believe you are using a Custom ASP.NET Sign in page. If not then create a custom sign in page and in that you can try Windows Authentication by default.

In case of failure just display a form which has option to enter username and password and a button to sign-in. On click of button user Forms Authentication to validate the user.

https://customlogingpagefbasp13.codeplex.com/

This is what you are looking for - http://blog.octavie.nl/index.php/2012/06/11/custom-sign-in-and-sign-out-page

  • Thanks for your answer, I will try this. ButI dont understand the "...and in that you can try WA by default". Are you suggesting that trying WA is done in code. How would I do that? – Cowborg Jul 15 '16 at 15:54
  • Check my second link.. this shows you how to auto signin using Windows Authentication... If that fails then you should display the username and password field for custom login.. – Amal Hashim Jul 15 '16 at 15:55
  • Ok! This really sounds like the solution I was looking for. Thanks! I will check it out and set this to correct answer if it works for me :) – Cowborg Jul 15 '16 at 15:57
  • Couldnt get this to work, and to be honest, it feels a bit hacky. I copied (through reflection) the MS-code, but interface must have changed since the article was written and contains internal code which I also copied and got into a dead end – Cowborg Jul 16 '16 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.