---
title: "Two Factor authentication"
canonical: "https://onesaitplatform-es.refined.site/space/OP/1528856577/Two%20Factor%20authentication"
format: markdown
---
> ℹ️ This functionality is currently available only for users with role ADMINISTRATOR.


There’s a two factor authentication (2FA) mechanism available for administrators on the platform. When enabled, the authentication flow of the platform is changed to fit the 2FA standard. 

# How it works

After successful log in (user credentials), a mail is sent by the platform to the user with a OTP (one-time-password) code. In order to complete the authentication process, user will need to provide this code to the platform.

The code will be valid for 5 minutes (This can be changed).

![image](media://975e431e-55d0-4232-9ffc-e5d01e8d163e)

![image](media://51ce0aab-dbb3-4412-b467-a9059cef4b72)

![image](media://d3eac699-ebd9-4332-adbe-6d69c8f74bf8)


## How to enable 2FA


To enable this security mechanism, the environment variable **TWOFA_ENABLED** must be set to true on the **controlpanel service.**


![image](media://c3d282de-c49f-4119-9852-7bb01b881b5a)