|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Method SetThreadPrincipalHi,
after attaching a principal to an AppDomain with SetThreadPrincipal, is it possible to undo this setting in order to set another principal ? The method AppDomain.SetThreadPrincipal doesn't accept NULL as an argument, so what ? Oriane Oriane,
The CurrentPrincipal property of the Thread type may be used for this purpose. However, the SetThreadPrincipal method of AppDomain, which specifies the default principal used for new threads, may only be called once. HTH, Nicole Show quoteHide quote "Oriane" <Ori***@Guermantes.com> wrote in message news:%23LXAjguWFHA.2740@TK2MSFTNGP14.phx.gbl... > Hi, > > after attaching a principal to an AppDomain with SetThreadPrincipal, is it > possible to undo this setting in order to set another principal ? > The method AppDomain.SetThreadPrincipal doesn't accept NULL as an > argument, > so what ? > > Oriane > > Hi Nicole,
"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message But if we want to reset all the threads of the thread pool ? Do we have tonews:OovqHsuWFHA.2740@TK2MSFTNGP14.phx.gbl... > Oriane, > > The CurrentPrincipal property of the Thread type may be used for this > purpose. use a sort of foreach loop ? > However, the SetThreadPrincipal method of AppDomain, which By the way, I'm currently modifying my code, and the fact is that after what> specifies the default principal used for new threads, may only be called > once. appears as minor modifications, it seems that the SetThreadPrincipal doesn't attach anymore the principal to the the current thread. However no exception is thrown. I don't really understand... If you don't have any idea, I will have to extract old files from VSS...:-(( "Oriane" <Ori***@Guermantes.com> wrote in message Why would you want to do this, particularly given that you're probably not news:%23Xu1uCvWFHA.1468@tk2msftngp13.phx.gbl... > Hi Nicole, > > "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message > news:OovqHsuWFHA.2740@TK2MSFTNGP14.phx.gbl... >> Oriane, >> >> The CurrentPrincipal property of the Thread type may be used for this >> purpose. > But if we want to reset all the threads of the thread pool ? actually using all threads in the pool? Perhaps if you could describe the scenario in which this principal change is being made, someone might be able to suggest a better mechanism... > Do we have to You would need to set the CurrentPrincipal for each active thread before the > use a sort of foreach loop ? next read of the principal against that thread. Looping through the thread pool (assuming that's even possible, which I suspect is not the case) is probably not the best way to go about this. >> However, the SetThreadPrincipal method of AppDomain, which No idea why this might be happening. However, you might want to run a >> specifies the default principal used for new threads, may only be called >> once. > By the way, I'm currently modifying my code, and the fact is that after > what > appears as minor modifications, it seems that the SetThreadPrincipal > doesn't > attach anymore the principal to the the current thread. However no > exception > is thrown. I don't really understand... > > If you don't have any idea, I will have to extract old files from > VSS...:-(( differences verification against the old versions in VSS before you resort to rolling back since the relevant change is presumably somewhere in the difference set... Show quoteHide quote > > > Why would you want to do this, particularly given that you're probably not It's very simple indeed. An applicative user logs in on my application,> actually using all threads in the pool? Perhaps if you could describe the > scenario in which this principal change is being made, someone might be able > to suggest a better mechanism... which has of course many threads, and I use the .NET mechanism for the .NET role based security, base on a generic principal, that I set with SetThreadPrincipal. It seemed to me that it was the "canonical" process. A user may want to log out. I agree that a logout could be seen as en applicatin exit. But the people from the business layer ask me for a logout function. Anyway if this is impossible, I suppose this is for good reasons and I don't want to waste my time trying to bypass the standard mechanism. Thanks a lot I'm guessing that there's probably no reason for more than one thread to be
running after the user logs off since the applicaiton is presumably just sitting around waiting for another user to log in. If I'm right about this, your best bet may simply be to explicitly set the principal for each thread as you initialize it in your code. If there's some additional requirement that would make this impractical, could you please explain? Show quoteHide quote "Oriane" <Ori***@Guermantes.com> wrote in message news:e7c%23PHwWFHA.3324@TK2MSFTNGP09.phx.gbl... >> Why would you want to do this, particularly given that you're probably >> not >> actually using all threads in the pool? Perhaps if you could describe >> the >> scenario in which this principal change is being made, someone might be > able >> to suggest a better mechanism... > It's very simple indeed. An applicative user logs in on my application, > which has of course many threads, and I use the .NET mechanism for the > .NET > role based security, base on a generic principal, that I set with > SetThreadPrincipal. It seemed to me that it was the "canonical" process. > > A user may want to log out. I agree that a logout could be seen as en > applicatin exit. But the people from the business layer ask me for a > logout > function. > > Anyway if this is impossible, I suppose this is for good reasons and I > don't > want to waste my time trying to bypass the standard mechanism. > > Thanks a lot > > Hi Nicole,
we finaly agree that the log out functionnality was not required. Thank you "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message This would have been the best solution.news:uE1%23gywWFHA.1148@tk2msftngp13.phx.gbl... > I'm guessing that there's probably no reason for more than one thread to be > running after the user logs off since the applicaiton is presumably just > sitting around waiting for another user to log in. If I'm right about this, > your best bet may simply be to explicitly set the principal for each thread > as you initialize it in your code. If there's some additional requirement > that would make this impractical, could you please explain?
Basic question about Public Private Key Pairs
Windows authentication How to protect data in executable file? Possible security error loading an Xsl? Forms authentication fails on Windows XP PRO Encrypting short data w/ asymmetric cipher Access Denied PasswordDeriveBytes in .NET 2.0 Beta Troubleshoot Caspol System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, Publi |
|||||||||||||||||||||||