Changing AppDomain.CurrentDomain Principal
From: Daren May (daren.getrid.may_at_spirent.com)
Date: 05/21/03
- Next message: Hilton: "Storing encrypted data in XML document"
- Previous message: Ken Hutchinson: ".NET security configurator won't work with URL address"
- Next in thread: Joe Kaplan: "Re: Changing AppDomain.CurrentDomain Principal"
- Reply: Joe Kaplan: "Re: Changing AppDomain.CurrentDomain Principal"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 21 May 2003 14:18:36 -0700
I have managed to confuse myself trying to solve the following problem:
I have an application that stores user accounts (and passwords) in a
database. I have created custom IPrincipal and IIdentity implementations
which seem to work fine, i.e. I can call:
MyPrincipal mp = MyPrincipal.ValidateLogin(userID, password);
AppDomain.CurrentDomain.SetThreadPrincipal(mp);
MessageBox.Show("Current Principal: " +
Thread.CurrentPrincipal.Identity.Name.ToString());
Which displays the correct Name value.
However, my requirements state that a user must be able to logoff and logon
as another account (lets avoid a debate why... I am hoarse from the
"discussion" already... suffice to say, the requirement isn't changing).
Now as the Help docs state, you cannot use SetThreadPrincipal more than once
(nice exception) and you can send a null (again, nice exception).
So, I am confused on how to change the user and associated permissions.
Should I be changing the Identity within the Principal, then reloading the
Permissions?
TIA
Daren
- Next message: Hilton: "Storing encrypted data in XML document"
- Previous message: Ken Hutchinson: ".NET security configurator won't work with URL address"
- Next in thread: Joe Kaplan: "Re: Changing AppDomain.CurrentDomain Principal"
- Reply: Joe Kaplan: "Re: Changing AppDomain.CurrentDomain Principal"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|