Error message

Failed to generate TOTP

Last updated 24 June 2026

Failed to generate TOTP

In short

This error means the system could not generate a TOTP, almost always because the TOTP Key entered for your trading account is wrong. Fix it by opening Accounts -> Trading Accounts, editing the account, entering the correct TOTP Key, and clicking Validate & Save. If your broker no longer shows the TOTP Key, disable TOTP on the broker and enable it again to get a fresh key, then copy that key into our system.

The system shows this error when it cannot generate a TOTP. The most likely cause is an invalid TOTP Key entered by the user.

TOTP and TOTP Key are not the same

Before you fix this, it helps to know the difference between these two terms:

TermWhat it is
TOTP KeyA unique, secret string of characters (also called a Secret Key or Seed), normally 10-20 characters long. It is shared only between a service (your broker, bank or email provider) and your authenticator app (such as Google Authenticator or Microsoft Authenticator). This key is passed to the TOTP algorithm, which produces a 6-digit TOTP. You enter the TOTP Key once while adding the account.
TOTPThe 6-digit code you see in your authenticator app. It changes every 30 seconds. It is generated from the TOTP Key. Do not enter this 6-digit code as the TOTP Key — they are not the same thing.

A common mistake: many users paste the 6-digit code from their authenticator app into the TOTP Key field. That is wrong. The TOTP Key is the longer secret string shown when you first set up TOTP — not the 6-digit code.

Solution

  1. Go to menu (Accounts -> Trading Accounts).
  2. Click the small EDIT icon next to your trading account’s client id or login id.
  3. If you do not know how to obtain the key, click on the big green help button at the top (just below the broker selection dropdown).
  4. Make sure you enter the correct TOTP Key.
  5. Click Validate & Save.

If your broker does not show the TOTP Key

Some brokers show the TOTP Key only once, at the time you set up TOTP, and hide it afterwards. If you did not save it, you cannot read the same key again from the broker.

In this case:

  1. Log in to your broker and disable TOTP on your broker account.
  2. Enable TOTP again. During this fresh setup, the broker shows a new TOTP Key.
  3. Copy this new TOTP Key.
  4. In AutoTrader Web, edit your trading account, paste the new TOTP Key, and click Validate & Save.

Note: If your broker is Dhan, a rejected TOTP is usually a temporary problem on Dhan’s side, not a wrong key. See Dhan login errors instead.

Did this solve your problem?
Contact support