|
JWSCL Documentation
|
procedure ImpersonateLoggedOnUser;
The ImpersonateLoggedOnUser function lets the calling thread impersonate the security context of a logged-on user. The user is represented by a token handle. If the current instance is already a thread token (=impersonated token), the method is just impersonating it. Otherwise if the current instance is a primary token, the method is converting it to a thread token and then impersonating it. However the second case is worth mentioning because the new thread token is not related to the current token instance. That means any operations on the current instance (e.g. set privileges) don't have an effect on the token of the thread. Create a new instance by calling TJwSecurityToken.CreateTokenByThread to get the new thread token or call ConvertToImpersonatedToken to get an thread token directly without creating a new instance.
|
Exceptions |
Description |
|
will be raised if the token is an impersonation token and does not have access type TOKEN_QUERY and TOKEN_IMPERSONATE will be raised if the token is a primary token and does not have access type TOKEN_QUERY and TOKEN_DUPLICATE | |
|
will be raised if a winapi function failed |
|
Copyright (c) 2010. All rights reserved.
This help was created by Doc-O-Matic sponsored by toolsfactory software inc. |
|
What do you think about this topic? Send feedback!
|