Combining forms and Windows authentication

  • Thread starter Nils Magnus Englund
  • Start date
N

Nils Magnus Englund

Hi!

I've read Paul Wilsons article on mixing forms and Windows authentication
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/htm
l/mixedsecurity.asp), but I didn't quite get it to work. I abandoned the
idea of sharing the same login page (since it doesn't give me any added
value for my application). I have a functional forms authentication now.

I've created a new page "WinLogin.aspx" (which doesn't contain any html,
only codebehind code). I've given everyone access to WinLogin.aspx using
Web.config:

<location path="WinLogin.aspx">
<system.web>
<authorization>
<allow users="?,*" />
</authorization>
</system.web>
</location>

I have also removed anonymous access to WinLogin.aspx in the IIS management
console.

In WinLogin.aspx.cs's Page_Load event, I have:

string Username = this.Request.ServerVariables["LOGON_USER"];
FormsAuthentication.RedirectFromLoginPage(Username, false);

Still, the windows login doesn't work as I hoped...

What am I doing wrong?

Thanks.


Sincerely,
Nils Magnus Englund
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top