bri189a Posted April 28, 2004 Posted April 28, 2004 I have a single class that I supply the user name, domain name, and password too... the idea is to get that class to run in the context of the information supplied to it. The main program does not need that level of access so the idea is not to use the 'run as' command or demand that the whole program has that level of access...only this one class needs it, is there a way to do that? Quote
AlexCode Posted April 28, 2004 Posted April 28, 2004 (edited) The only way I see it's to wrap yor class as COM and add it to the COM+ Service... There you can specify the security context you want it to run... The System.EnterpriseServices namespace does that for you... I really don't know any other way... Alex :p Edited April 28, 2004 by AlexCode Quote Software bugs are impossible to detect by anybody except the end user.
AlexCode Posted April 28, 2004 Posted April 28, 2004 The question stayed on my head, so I did some investigation and found this MSDN URL that will really help you... http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconRole-BasedSecurity.asp Alex :p Quote Software bugs are impossible to detect by anybody except the end user.
bri189a Posted April 29, 2004 Author Posted April 29, 2004 Thanks for the reply. I read most of that stuff on MSDN before. The problem I have with impersonation is that the .NET methods don't work on 2000 unless you make the computer not secure... in the past I've always used the advapi LogOnUser function. I'm trying to avoid starting a whole new process in the background for this one function, but it looks like I may have to - I can't seem to find anything that will just run a certain function in the context of a user without use the .NET impersonation which doesn't work on 2000... those dang security classes descriptions can be so vague at times though it could be a snake that would've bit me by now too.... The next problem I've had is that the wrapper I made for the LogOnUser for trying to do it as seperate process never seems to work in I think it's called 'Network Mode'... it's one of the flags, basically instead of validating with the local authority it validates when the code is run (for working across domains where no trust is established).... and the other mode that works is actually logging the user into the whole computer (create a profile folder if not one present, etc....) whichis fine, but I need the network mode... I'll keep at it and maybe I'll figure out something, I can send that wrapper class if your interested in taking a look at it. Thanks for the help though. Quote
AlexCode Posted April 29, 2004 Posted April 29, 2004 But is COM+ infrastructure out of the question? Cause this kind of do a lot of work for you in that base... You can send me that class and I'll take a look at it... you can even contact me thru MSN Messenger if you will... Alex :p Quote Software bugs are impossible to detect by anybody except the end user.
bri189a Posted April 29, 2004 Author Posted April 29, 2004 But is COM+ infrastructure out of the question? Cause this kind of do a lot of work for you in that base... You can send me that class and I'll take a look at it... you can even contact me thru MSN Messenger if you will... Alex :p When I get in to work tomorrow I'll try to PM you the class... I'll pop it up in a zip file on my server or something... I'll have to read up on COM+... I'm what I'm trying to do is possible, it's just a matter of in-experiance...as often is the case...thus I don't know of it... Quote
AlexCode Posted April 30, 2004 Posted April 30, 2004 Do that... Meanwhile... search on the net (MSDN & Google) for the System.EnterpriseServices namespace. It's not hard... it's just a matter of implementing the interface and 80% of the work is donne! Alex :p Quote Software bugs are impossible to detect by anybody except the end user.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.