Actions111
- Item Actions
- Webhook Actions
- Collection Actions
- File Actions
- Activity Actions
- Asset Actions
- Authentication Actions
- Extension Actions
- Field Actions
- Folder Actions
- Permission Actions
- Preset Actions
- Relation Actions
- Revision Actions
- Role Actions
- Setting Actions
- User Actions
- Utility Actions
Overview
This n8n node enables Two-Factor Authentication (2FA) for a user in a system, likely Directus. It is used to verify and activate 2FA by providing an OTP (One-Time Password) generated with a secret. This is typically part of a security workflow where users are required to set up 2FA for enhanced account protection.
Common scenarios:
- Enforcing 2FA setup during user onboarding.
- Automating the process of enabling 2FA for users via workflows.
- Verifying that a user's 2FA setup is correct before granting access.
Practical example:
A company wants all employees to enable 2FA on their accounts. An admin can use this node in an n8n workflow to automate the verification and activation of 2FA after users submit their OTPs.
Properties
| Name | Meaning |
|---|---|
| OTP | The One-Time Password generated using the provided secret. Used to verify the 2FA setup. |
| Secret | The 2FA secret previously generated (e.g., from a /tfa/generate endpoint). |
Output
The node outputs a json field containing the result of the 2FA enablement operation. The exact structure depends on the API response but typically includes confirmation of success or details about any errors encountered.
Dependencies
- Requires access to a Directus instance or similar backend supporting 2FA operations.
- May require authentication credentials (API key, token, etc.) configured in n8n.
Troubleshooting
Common issues:
- Invalid OTP: If the OTP does not match the expected value for the given secret, the operation will fail. Ensure the OTP is freshly generated and matches the secret.
- Missing or incorrect secret: Providing an incorrect or expired secret will prevent successful 2FA activation.
- API connection errors: Network or authentication issues may cause failures; check your API credentials and connectivity.
Error messages you might encounter:
- "Invalid OTP" – Double-check the OTP and secret.
- "Secret not found" – Ensure the secret is correctly retrieved from the 2FA generation step.
- "Authentication failed" – Verify your API credentials and permissions.