IMetabasePasswordPolicy.CheckPassword

Syntax

CheckPassword(User: IMetabaseUser; NewPassword: String; OldPassword: String);

Parameters

User. User, for whom the correctness of a new password should be checked.

NewPassword. Password to be checked.

OldPassword. The current password that is used for comparison during check.

Description

The CheckPassword method validates user new password for consistency according to the specified passwords policy in the security manager. If password does not correspond to the specified passwords policy, an exception is thrown.

Example

To execute the example, add a link to the Metabase system assembly.

Sub UserProc;
Var
    Mb: IMetabase;
    Sec: IMetabaseSecurity;
    User: IMetabaseUser;
Begin
    Mb := MetabaseClass.Active;
    Sec := Mb.Security;
    User := Sec.Users.Item(
0);
    Sec.Policy.PasswordPolicy.CheckPassword(User, 
"qwe""qwr");
End Sub UserProc;

After executing the example, if a restriction is set in the passwords policy for a minimum difference between the current password and a new one for more than one character, an exception is thrown.

See also:

IMetabasePasswordPolicy