|
JWSCL Documentation
|
TJwOnElevationGetCredentials = procedure ( var Abort : Boolean; var UserName, Password : TJwString; var EncryptedPassword : Boolean; var Entropy : PDataBlob; var EncryptionPrompt : Boolean; var Environment : Pointer; var lpStartupInfo: TStartupInfoW) of object;
|
Parameters |
Description |
|
Abort |
Set abort to true if you like to abort the elevation process. A EJwsclAbortException will be thrown though. |
|
UserName |
Receives a username that has administrative privileges. By default it contains "Administrator.". However the JwElevateProcess Function does not check whether the user is really an administrator or even exists. It just tries to create the process and will fail if the user does not exist. The new process mayb not have administrator powers. |
|
Password |
This parameter receives a plaintext or encrypted password depending on parameter EncryptedPassword. |
|
EncryptedPassword |
Defines whether parameter Password is encrypted (true) or plaintext (false). |
|
Entropy |
Receives additional data that was used for the encryption and must be supplied to decrypt the password. |
|
EncryptionPrompt |
This parameter defines whether a decryption prompt is shown (true) to confirm the decryption by the user. Set to false to suppress the dialog (default). |
|
Environment |
This parameter receives the user environment block created by WinAPI CreateEnvironmentBlock. The data is freed automatically if Abort is false. |
|
lpStartupInfo |
This parameter receives a StartupInfo structure that contains more information for CreateProcess. The cb member (size) is ignored. |
The TJwOnElevationGetCredentials event is called by the JwElevateProcess Function if
It receives user credential to be used by CreateProcess.
Any exception thrown in this function is returned by the JwElevateProcess Function.
The exception EjwsclCryptApiException will be raised if the encrypted password could not be decrypted.
This examples shows how to encrypt a password for OnElevationGetCredentials:
procedure TForm1.OnElevationGetCredentials(var Abort: Boolean; var UserName, Password: TJwString; var EncryptedPassword: Boolean; var Entropy: PDataBlob; var EncryptionPrompt: Boolean; var Environment: Pointer; var lpStartupInfo: TStartupInfoW); begin //set default username YourCredentialPrompt.UserName := UserName; //run login dialog Abort := not YourCredentialPrompt.Execute; if Abort then exit; UserName := YourCredentialPrompt.UserName; //secure password in memory - //no prompt and on local machine only Password := JwEncryptString(YourCredentialPrompt.Password, '', false,true); //the password is encrypted EncryptedPassword := True; end;
|
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!
|