Multi-Factor Authentication
Edit on GitHubMulti-Factor Authentication (MFA) adds an extra layer of security for customers, Back Office users, agents, merchant, and merchant agent users by requiring multiple methods of authentication before allowing an action.
Benefits of MFA:
- Enhanced security with an extra layer of protection
- Enhanced privacy with better protected personal data
- Supports compliance with security regulations and industry standards
MFA flow for protected actions
The login process with MFA looks as follows:
-
Initial MFA check: The system checks if MFA is enabled for the user. If no MFA methods are enabled, the authentication process continues without additional validation.
-
Fetch enabled MFA types: The system retrieves the user’s enabled MFA methods from a specific endpoint depending on the user type:
- Customer:
multi-factor-auth/get-customer-enabled-types - Agent:
multi-factor-auth/get-user-enabled-types - Back Office user:
multi-factor-auth/user/get-enabled-types - Merchant:
multi-factor-auth/merchant-user/get-enabled-types - Merchant agent:
multi-factor-auth/merchant-agent-user/get-enabled-types
- Evaluate the number of enabled MFA methods:
- Multiple MFA methods: the system presents a selection screen where the user selects a preferred authentication method
- One MFA method: the system proceeds to verify the user using their only MFA method
- Send the authentication code: The system sends a verification code through the appropriate endpoint based on the user type:
- Customer:
multi-factor-auth/send-customer-code - Agent:
multi-factor-auth/send-user-code - Back Office user:
multi-factor-auth/user/send-code - Merchant:
multi-factor-auth/merchant-user/send-code - Merchant agent:
multi-factor-auth/merchant-agent-user/send-code
The delivery method depends on the MFA configuration:
- If multiple MFA methods are enabled, the authentication code is sent via the platform selected by the user
- If only one MFA method is enabled, the authentication code is sent via that method’s platform
- Code validation: After the authentication code is sent, the system presents a code validation form to the user. The user enters the received authentication code in the form.
If the code is correct, authentication is successful. If incorrect, the user needs to double-check the code and try entering again.

Login MFA flow
For the login MFA flow, MFA is triggered only after validating credentials to prevent unnecessary MFA processing.
- On the login page, customer/user enters email and password.
- The system validates the credentials. If invalid, authentication fails, and the customer/user is prompted to try again. If valid, the system proceeds to check if MFA is enabled.
- If MFA is enabled, the process continues as described in MFA flow for protected actions.
MFA protected actions
MFA adds an additional authentication layer for critical operations, protecting both user accounts and sensitive business data.
Protected actions:
- All user types:
- Login authentication
- Password changes
- Customer:
- Update email address
- Delete account
- Back Office user and agent:
- Update user profile information
- Create, update, or delete other users’ accounts
- Create, update, or delete API keys
- Merchant and merchant agent user: Update user password
You can configure other actions to be protected with MFA according to your requirements. For instructions on integrating MFA into forms and actions, see Install the Multi-Factor Authentication feature.
MFA grace period
After a customer/user successfully enters a valid MFA code, there’s a configurable time interval during which MFA validation isn’t required for subsequent actions. This improves user experience because users sometimes need to perform multiple protected actions within a short period of time.
For details on configuring the grace period, see Install the Multi-Factor Authentication feature.
Note: To enhance security, the Multi-Factor Authentication system automatically invalidates all active MFA codes when a user logs in. This security measure ensures:
- Fresh authentication required: Each login requires a new authentication code, even if previous session codes are still technically valid
- Prevention of code reuse: Old codes from expired or terminated sessions cannot be reused
- Protection against session hijacking: Attackers cannot use intercepted codes from previous sessions
- Seamless user experience: Code invalidation happens automatically in the background without requiring additional user actions
This security mechanism applies to all user types: customers, Back Office users, agents, merchants, and merchant agent users.
Brute force protection
The Multi-Factor Authentication system includes protection against brute force attacks. This mechanism limits the number of failed MFA code entry attempts a customer/user can make within a single validation flow.
If a customer/user reaches the configured number of failed attempts to enter the code, the following happens:
- The system resets the MFA flow
- The page is refreshed, and the customer/user must start the authentication process from the beginning
- All previously generated codes become invalid
For instructions on configuring brute force protection, see Install the Multi-Factor Authentication feature.
MFA code request limit
Each MFA code request sends a new code, for example, by email. Without a limit, a person who knows the password of an account, or who has an authenticated session for MFA activation, could request codes repeatedly and flood the inbox of the account owner. To prevent this, the number of code requests is limited. By default, an account can request up to 3 MFA codes within 15 minutes. The limit counts the code requests for login and for MFA activation together. When the limit is reached, no code is sent, and the customer or user sees an error message about too many requested codes. The Glue APIs respond with the 429 HTTP status and the 5911 error code.
The code request limit is defined by the CUSTOMER_CODE_SEND_LIMIT and CUSTOMER_CODE_SEND_LIMIT_TTL_SECONDS constants for customers, and by the USER_CODE_SEND_LIMIT and USER_CODE_SEND_LIMIT_TTL_SECONDS constants for Back Office users, Merchant Portal users, and agents. The first constant of each pair sets the number of codes, and the second one sets the time window in seconds. For instructions on changing the limit, see Install the Multi-Factor Authentication feature.
Multi-Factor Authentication methods
The feature is shipped with the email authentication method. For instructions on installing this method, see Install email Multi-Factor Authentication method.
You can set up your own methods by implementing a custom MFA type plugin. For instructions, see Create custom Multi-Factor Authentication methods.
Thank you!
For submitting the form