|
|
|
|
|
TwoFactorAuthenticationCheckCode (Function) In french: DoubleAuthVérifieCode Verifies the code given by an authentication application. IF TwoFactorAuthenticationCheckCode(nCode, sCléTOTP) = False THEN
Error("Le code ne correspond pas.")
RETURN
END
Syntax
<Result> = TwoFactorAuthenticationCheckCode(<Code> , <TOTP key>)
<Result>: Boolean - True if the code is valid,
- False otherwise.
<Code>: Integer or character string 6-digit code generated by the authentication application. <TOTP key>: Character string, Buffer or secret string TOTP key of the user to be authenticated.
New in version 2025Secret strings: If you use the secret string vault, the type of secret string used for this parameter can be "Buffer - ASCII" or "Buffer - UTF-8". To learn more about secret strings and how to use the vault, see Secret string vault. New in version 2025 Remarks Validity period - The code validity period is slightly longer than the period shown by the authentication application. For example, when Google Authenticator shows a new code, the previous code is still valid for 1 minute.
- TwoFactorAuthenticationCheckCode checks the codes generated 1 minute before and 1 minute after the verification request is made.
For a website, make sure the UTC time of the web server is correct. The server that hosts the website may be in a different time zone than the users of the site, but the server and the devices must use the same time.
Related Examples:
|
Training (WINDEV): WD Two-factor Authentication
[ + ] This example shows how to use two-factor authentication to secure access to user accounts. It uses TOTP authentication, which generates a 6-digit code every 30 seconds. The code is generated by all Authenticators that use TOTP (Google, Microsoft, etc.)
|
|
Training (WEBDEV): WW_Two-factor_Authentication
[ + ] This example shows how to use two-factor authentication to secure access to user accounts. It uses TOTP authentication, which generates a 6-digit code every 30 seconds. The code is generated by all Authenticators that use TOTP (Google, Microsoft, etc.)
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|