Validate Digest Web Password

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 11


Validate Digest Web Password (userName; password) Boolean

ParameterTypeDescription
userNameTextUser name
passwordTextUser password
Function resultBooleanTrue=Authentication OK,
False=Authentication failed

Description

The Validate Digest Web Password command can be used to check the validity of the identifying information (name and password) provided by a user connecting to the Web server. This command must be used in the On Web Authentication Database Method in the context of Web authentication in Digest mode (see the Connection Security section).

In the userName and password parameters, pass the identifying information of the user stored locally. The command uses this information to generate a value that it compares with the information sent by the Web browser.

If the values are the same, the command returns True. Otherwise, it returns False.

You can use this mechanism to manage and maintain your own secure access system to the Web server by programming. Note that Digest validation cannot be used jointly with 4D passwords.

Note: If the browser does not support Digest authentication, an error is returned (authentication error).

Example

Example using On Web Authentication Database Method in Digest mode:

      ` On Web Authentication Database Method
   C_TEXT($1;$2;$5;$6;$3;$4)
   C_TEXT($user)
   C_BOOLEAN($0)
   $0:=False
   $user:=$5
      `For security reasons, refuse names containing @
   If (WithWildcard($user))
   $0:=False
      `The WithWildcard method is described in the "On Web Authentication Database Method" section
   Else
      QUERY([WebUsers];[WebUsers]User=$user)
      If (OK=1)
         $0:=Validate Digest Web Password($user;[WebUsers]password)
      Else
         $0:=False `User does not exist
      End if
   End if

See Also

On Web Authentication Database Method.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next