To enhance the security of your Rocket.Chat account across all platforms, you can enable two-factor authentication (2FA). 2FA adds an extra layer of protection by requiring a second form of verification, in addition to your password, when you sign in or perform sensitive actions.
Only workspace administrators can configure two-factor authentication (2FA). See Two-Factor Authentication Configuration for setup instructions.
Before you begin
Confirm that your workspace administrator has enabled 2FA. If you don't see Two Factor Authentication in your Security settings, the feature isn't turned on yet. Contact your administrator.
For TOTP setup, install an authenticator app on your phone before starting. Common options include Google Authenticator, Authy, and Duo.
2FA methods
Rocket.Chat supports two methods:
TOTP (Time-Based One-Time Password): A 6-digit code generated by an authenticator app, refreshing every 30 seconds.
Email: A one-time verification code sent to your registered email address.
Depending on your workspace configuration, you may be able to enable one or both methods. If you're unsure which is available, contact your workspace administrator.
If you sign in with an OAuth provider, such as Google, GitHub, or GitLab, you are prompted for your 2FA code after the provider redirects you back to Rocket.Chat. Enter the code from your authenticator app or the code emailed to you to complete sign-in.
Enable 2FA via TOTP
TOTP generates a temporary numeric code based on a standardized algorithm and the current time. Because the code refreshes frequently, it provides a strong second layer of security beyond your password.
To enable TOTP:
In Rocket.Chat, click your avatar and go to Account → Profile.
Navigate to Security → Two Factor Authentication.
Toggle on Two-factor authentication via TOTP. A QR code, a manual setup code, and a verification field appear on screen.
Open your authenticator app and add a new account by either:
Scanning the QR code with your phone's camera, or
Selecting your app's "Enter a setup key" (or similarly named) option and pasting the alphanumeric code shown above the QR code.
Your account appears in the authenticator app as
Rocket.Chat:<username>and immediately starts displaying a 6-digit code that refreshes every 30 seconds.Back in Rocket.Chat, type the current 6-digit code from your authenticator app into the Enter code provided by authentication app field.
Click Verify.
After this point, you'll be prompted for a TOTP code when logging in or performing sensitive actions, depending on your workspace settings.
Save your backup codes
Once verification is complete, Rocket.Chat displays a list of backup codes. Save these codes immediately in a secure location, such as a password manager.
Backup codes are the only way to regain access to your account if you lose your phone or authenticator app. If you run out of backup codes, you'll need to ask your workspace administrator to reset your TOTP.
Enable 2FA via email
This method sends a one-time verification code to your registered email address each time you sign in or perform a sensitive action.
To enable email-based 2FA:
Click your avatar and go to Account → Profile.
Navigate to Security → Two Factor Authentication.
Toggle on Two-factor authentication via Email.
That's it. From now on, a verification code is emailed to you whenever you log in or perform sensitive actions.
Request a new email code
When you sign in, Rocket.Chat asks for the code sent to your email. If the email doesn't arrive or the code has expired, click Resend email in the code dialog. Rocket.Chat then shows A new code is sent at most once a minute. If you requested one in the last minute, use that code.
Rocket.Chat sends a verification code at most once per minute. If you request another code within that period, no new email is sent, even if Rocket.Chat displays a Sent confirmation. Use the code from your most recent email.
Each new code replaces the previous one. Only the code from the latest email works.
After too many incorrect entries, the current code stops working, even if you then type it correctly. Wait a minute, then click Resend email to get a new code. Your workspace administrator sets how many incorrect entries are allowed.
If you signed in with an OAuth provider and keep the code dialog open too long, your sign-in attempt expires. Clicking Resend email then shows Your login attempt expired. Please log in again. Close the dialog and sign in again.
Disable 2FA on your account
You can disable 2FA at any time from your account settings.
To disable 2FA via TOTP:
Click your avatar and go to Account → Profile.
Navigate to Security → Two Factor Authentication.
Toggle off Two-factor authentication via TOTP.
Enter the current 6-digit code from your authenticator app and click Verify.
To disable 2FA via Email:
Click your avatar and go to Account → Profile.
Navigate to Security → Two Factor Authentication.
Toggle off Two-factor authentication via Email.
Enter the 6-digit code sent to your email and click Verify.
Once verification is complete, 2FA is disabled for your account.
FAQs
Setup & access
Can I use both TOTP and email 2FA at the same time?
Yes, if your workspace allows both methods. You can enable each independently from your Security settings.
When both are active, you can choose which code to use at login.
Do I have to enter a 2FA code every time I log in?
Not necessarily. After a successful 2FA verification, you won't be asked for a code again for a period set by your workspace administrator (30 minutes by default). This is controlled by the Remember Two Factor for (seconds) workspace setting.
I'm getting 2FA emails but I don't remember enabling it. Why?
By default, email-based 2FA is enabled for any user who signs up with an email address. To disable it from your account settings, see To disable 2FA via Email.
I signed in with Google (or GitHub, GitLab, etc.) and wasn't asked for my 2FA code. Is that expected?
A 2FA prompt only appears if you have 2FA enabled on your own account under Account → Profile → Security → Two Factor Authentication. If neither TOTP nor email 2FA is enabled there, OAuth sign-in completes without a code. You may also still be inside the Remember Two Factor for (seconds) window from a previous sign-in. Confirm both your profile settings and your workspace's 2FA configuration with your administrator.
I got a "Challenge expired" error after signing in with an OAuth provider. What happened?
You took longer than the allowed window to enter the code, so the challenge was invalidated. Start the OAuth sign-in again. A new challenge is generated for each attempt. For details, see Request a new email code.
I got a "Maximum attempts reached" error. How long do I have to wait?
You entered an incorrect code more times than the limit set by your workspace administrator in the Maximum Invalid Email OTP Codes Allowed setting. Wait until the rate-limit window passes, then start a new sign-in attempt. If you're locked out repeatedly, contact your administrator. For details, see Request a new email code.
TOTP
Why isn't a QR code showing after I toggled on TOTP?
The QR code, manual setup code, and verification field are generated only after the toggle is switched on. If the screen stays blank, refresh the page and toggle the option on again.
Why is my 6-digit code being rejected?
TOTP codes refresh every 30 seconds, so make sure you're entering the current one. If it keeps failing, your phone's clock may be out of sync. Check that your phone is set to automatic date and time. If the problem continues, ask your administrator about the Maximum Delta setting, which controls how long each token remains valid (tokens are valid for 30 × Maximum Delta seconds, which helps when client clocks aren't perfectly in sync with the server).
Which authenticator app should I use?
Any TOTP-compatible app will work. Common choices are Google Authenticator, Authy, and Duo. Some apps offer cloud sync across devices, which can simplify recovery if you change phones. Check your app's settings if that matters to you.
How do I move my Rocket.Chat 2FA to a new phone?
While you still have access to your old phone, sign in to Rocket.Chat, disable TOTP, then re-enable it on your new phone (this generates a new QR code to scan with the new device). If you no longer have the old phone, sign in using a backup code, then disable and re-enable TOTP from your new device.
Why isn't my emailed code arriving?
Check your spam or junk folder first. You can also click Resend email in the code dialog. See Request a new email code. If the email still doesn't arrive, your workspace's email service may not be configured correctly. Contact your administrator.
Is email 2FA as secure as TOTP?
TOTP is generally considered stronger because the code is generated locally on your device and doesn't travel over the network. Email 2FA depends on the security of your email account. If that account is compromised, an attacker could intercept your codes. Where possible, use TOTP.
How long is an emailed 2FA code valid?
By default, an emailed code is valid for 1 hour (3600 seconds). Your administrator can adjust this in workspace settings.
Recovery and lost access
What if I lose my phone or authenticator app?
Sign in using one of your backup codes, then disable TOTP and re-enable it on your new device.
What if I no longer have access to my registered email?
Contact your workspace administrator for help regaining access to your account.