younifyd
Menu

Generate Two Factor Secret

Generate Two-Factor Authentication Secret

POST/users/me/tfa/generate

Use it in a workflow

  1. Add a step and choose the Directus connector.
  2. Pick the Generate Two Factor Secret action (under Users).
  3. Fill in the fields below, then reference the result from later steps as {{generateTwoFactorSecret.response.data}}.

Request

Request body

Enter the body as JSON in the step's Body field.

passwordstringrequired

The user's password.

json
{
  "password": "string"
}

Response

Returns 200 with an object. Read it in later steps with {{generateTwoFactorSecret.response.data.<field>}}.

secretstring

OTP secret to be saved in the authenticator app.

otpauth_urlstring

otpauth:// formatted URL. Can be rendered as QR code and used in most authenticator apps.

json
{
  "secret": "string",
  "otpauth_url": "string"
}

Need more? See the Directus guide for connection setup and behaviour shared by every action.

Was this page helpful?
Generate Two Factor Secret — Directus — Documentation