Set Windows Principal




My current legacy asp/ application uses IIS Windows
Authentication at present. What I need to do is let a user coming from
another site enter mine without being asked to log in. My first stab at this
is to create a page named LoginService.aspx that expects a username and
password in a posted form. It should then log the user in using the
LogonUser API from advapi32 and replace the Principal object for the thread
using Thread.CurrentPrincipal. I have coded this but it doesn´t seem to work

1) How do I suppress the Windows dialog box when accessing
LoginService.aspx? Keep it in another vroot?

2) If the user must, through his use of the site, access an OLAP server that
requires Windows authentication would the OLAP server not see the Windows
Principal I replaced for the Thread?


ps. The code I use in Page_Load:

// call LogonUser and get a token
WindowsIdentity identity = new WindowsIdentity(token);

Thread.CurrentPrincipal = new WindowsPrincipal(identity);

// redirect to a page that accesses an OLAP server.


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