1

I have created a web application with Forms based authentication and Windows authentication . When i login into site i get a Custom sign in page where there is a drop down box to select either windows or Forms .

My Requirement is now however to create a custom login page where if the user is from same AD will automatically log into site else will be send to a page where he can specify the form based credentials.

Please provide your Suggestions or Answers to execute it.

  • 1
    I don't think this will be possible, the users must at least click a button.. coz if you write your logic on PageLoad to try Windows Users to login and if he is not.. the logic may result infinite since each time it will redirect to Login page on failure! – Arsalan Adam Khatri Aug 30 '13 at 13:08
1

What I usually do is create a custom login page based on the existing SharePoint FBA login page. I simply add an extra link to this page, call it "Employee Login", "Windows Login" or something similar. I then point this link to the built in SharePoint Windows Authentication page. External users can login with their FBA credentials. Internal users can click the link to login.

This gets rid of the drop down, so you have a single login page.

Arsalan is correct - you can't really do this automatically, because if you want to "test" a user for windows authentication - external users will get a windows authentication prompt on the browser.

And of course the other way is to simply have 2 zones - one for FBA, one for windows authentication. Windows users would go to 1 url (maybe an internal url), FBA users would go to another.

  • What you did is exactly what I want to do. Add a link to the default.aspx page, from the FBA authentication. But I really can't find how to do this. If you can help me, would be great. Thanks – Nico Apr 2 '14 at 11:51
  • I usually use the link: <a href="/_windows/default.aspx?ReturnUrl=%2f_layouts%2f15%2fAuthenticate.aspx%3fSource%3d%252F&Source=%2F">Windows Login</a> This will always redirect the user to the root of the site after login though. You'll need to add some backend logic (or potentially js) if you want to adjust to the exact page they were attempting to access. – Chris Coulson Apr 2 '14 at 15:47
  • Thanks for your reply, I managed to do what I wanted. Thanks! – Nico Apr 3 '14 at 6:30
  • Could you please let me know how you managed to get login page for windows authentication? Thanks, Dinesh – user40008 Feb 26 '15 at 14:57
  • The only thing I did was add a link to the forms authentication page to SharePoint's built in windows authentication page. The link is in my previous comment. – Chris Coulson Feb 26 '15 at 18:45

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.