How to implement PasswordLess with PowerBuilder?

Estimated reading: 2 minutes 111 views

From Visual Guard 2020.2 you can use PasswordLess authentication.

The VGPBRuntime has a new method

guo_vgmanager.of_verifyuser_mfa( <username>, <action>, <MFA Mode>, <MFA transport> )

Variable nameValues
Usernameusername of your PassordLess user
MFA Actionvg_n_authenticationmode.MFA_Action_SendOTP // Send the OTP
vg_n_authenticationmode.MFA_Action_AuthenticateOTP // Authenticate the OTP
vg_n_authenticationmode.MFA_Action_SendLink // Send Link
MFA Modevg_n_authenticationmode.MFA_Mode_OTP // The message contains OTP
vg_n_authenticationmode.MFA_Mode_Link // The message contains a MagicLink
MFA Transportvg_n_authenticationmode.MFA_Transport_SMS // Send the message by SMS
vg_n_authenticationmode.MFA_Transport_EMail // Send the message by Email
Parameters of of_verifyuser_mfa

How to implement PasswordLess with an OTP?

The OPT (One-Time Password) can be sent by SMS or Email. This requires an MFA key to be installed on the repository.

Visual Guard Passwordless Authentication with OTP is a two-step process: first the OTP request, then the OTP verification.

To request an OTP, you need to set the username and the action request

// Initialize local variables
integer li_err
string ls_code // Get the OPT of the user

// Request to send an OTP
li_err = guo_vgmanager.of_verifyuser_mfa( <UserName>, vg_n_authenticationmode.MFA_Action_SendOTP, vg_n_authenticationmode.MFA_Mode_OTP, vg_n_authenticationmode.MFA_Transport_SMS) 

//Get the OPT from the User.
ls_code = f_input("MFA", "Insert the incorrect code", "[0-9]+")

// Check the OTP received by the user
li_err = guo_vgmanager.of_verifyuser_mfa(<UserName>, vg_n_authenticationmode.MFA_Action_AuthenticateOTP, vg_n_authenticationmode.MFA_Mode_OTP, ls_code) 


How to use PasswordLess with Magic Links?

Magic links are a one-time use link sent to the user during the authentication process.

The Magic Link can be sent by SMS or Email. This requires an MFA key to be installed on the repository.

Visual Guard Passwordless authentication with magic links is a one step.

// Initialize local variables
integer li_err

// Request to send a Magic Link
li_err = guo_vgmanager.of_verifyuser_mfa( <Username>, vg_n_authenticationmode.MFA_Action_SendLink , vg_n_authenticationmode.MFA_Mode_Link , vg_n_authenticationmode.MFA_Transport_SMS) 

// If li_err equals 1 the authentification is succeed