How to authentication with MFA ?

Estimated reading: 2 minutes

To use VG MFA, you need VGMFA license

What is the VGMFAAuthMode ?

In Visual-Guard has 2 types of authentification

  • VGMagicLink that send a link when the user click that validate the authentification (Synchro System)
  • VGOTP that send to the user an OTP after the user need put in the UI

What is the VGMFATransportMode ?

  • SMS that send to a user a SMS contains the MFA mode
  • Email that send an email to the user


// In this case the VGPrincipal is already load, you want to ask MFA authentification 

var auth = runtime.MFAAuthentication(VGMFATransportMode.SMS, VGMFAAuthMode.OTP);
 //MFA mode selected = OTP sent by SMS
     //If MFA not yet enabled, then Enable it by program

//The user don't have any any
     Console.WriteLine("Email not yet available ");
     //Set an email address

//The user don't have any mobile phone
if (auth.HasUserAccountMissingMobilePhone)
     Console.WriteLine("Mobile number not yet available");
     //Set an a mobile number

// The user need to provide an OTP 
if (auth.IsMFAWaitingUserAction)
     Console.WriteLine("Need OTP value:");
     var otp = Console.ReadLine();
     auth = runtime.MFAAuthentication(otp);
Share this Doc