Sign in as different user when using Integrated Windows Authentication

Posted by Sam on Stack Overflow See other posts from Stack Overflow or by Sam
Published on 2010-05-04T15:43:04Z Indexed on 2010/05/04 15:48 UTC
Read the original article Hit count: 301

I have restricted access to a site by using Integrated Windows Authentication and turning off anonymous access. This way I can then show them their real name (from looking up on Active Directory and using the server variable LOGON_USER) and do other related Active Directory tasks.

How can I then prompt again for their user credentials, through a 'sign in as other user' link , showing the browser prompt (like you would get on a browser like Chrome or Firefox, or if the site was not in the 'Intranet' zone in IE) rather than a Web Form?

Since SharePoint offers this functionality, I assume there is a way to do this through code, but I don't know what code can do this (using C#). I can send a 401 header which makes the prompt appear, but how do you then confirm if they are logged in?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#