Two-Factor Auth

KS
Last updated 12 days ago

Register your users with Authy and require phone verification on register

By integrating your Authy account with your Mason Register feature, you may register your user with Authy prior to registering with your application. Mason will validate the user's provided phone number after sending the user's metadata to your server. You may want to wait until receiving the validation confirmation from Mason before allowing your user to complete her registration.

Collecting a Phone Number

Your registration form must contain required fields named email and phone in order to register with Authy. Removing these fields, or leaving them optional and blank will allow the user to skip two-factor authentication.

Authy User ID

Mason will attempt to register your user with your Authy application, and if it succeeds the authyUserId will be included as a string in your user's metadata and sent to your registration endpoint.

{
email: 'john@appleseed.com',
password: 'verysecure',
authyUserId: '8940385',
}

You must save the authyUserId along with your user's metadata for later use. Mason Login will use it to require two-factor authentication on subsequent login events.

Server-side Validation

See Authy Server-side Validation‚Äč