This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
WEB Validate digest
|
WEB Validate digest ( userName ; password ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
userName | Text |
![]() |
User name | |||||
password | Text |
![]() |
User password | |||||
Function result | Boolean |
![]() |
True=Authentication OK, False=Authentication failed | |||||
The WEB Validate digest command checks 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 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:=WEB Validate digest($user;[WebUsers]password)
Else
$0:=False `User does not exist
End if
End if
Product: 4D
Theme: Web Server
Number:
946
Created: 4D v11 SQL
Renamed: 4D v13 (Validate Digest Web Password)
4D Language Reference ( 4D v20 R7)