Validate TOTP Token - No Credential Setup Required

Custom n8n workflow to verify 6-digit TOTP codes against a base32 secret using Python code, ideal for 2FA authentication without credentials.

n8n
Validate TOTP Token - No Credential Setup Required

This workflow provides a straightforward TOTP validation mechanism using a Python function node in n8n. It takes a base32-encoded TOTP secret and a 6-digit user code as inputs, generates the expected code from the secret, and compares them. Outputs 1 for valid matches and 0 otherwise, routing through an IF node for true/false branches.

Key benefits include no need for n8n credentials, full customizability, and prevention of leading zero issues by treating codes as strings. It's lightweight, secure, and integrates easily into larger auth systems, saving development time on 2FA logic.

Use cases: Validate user-provided 2FA codes after retrieving secrets from databases; enhance login flows in apps or APIs; test TOTP implementations without external services. Setup involves modifying lines 39-40 in the code node for your inputs and testing via the manual trigger.

$7.99
Last updated October 3, 2026
30-day money-back guarantee
Instant download
Lifetime updates included

New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.

Secure checkout powered by Stripe

Support

How to import this workflow into n8n

  1. 1Purchase or download the workflow to get the n8n workflow JSON file.
  2. 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
  3. 3Open each node marked with a credential warning and connect your own accounts and API keys.
  4. 4Run the workflow once manually to verify the data flow, then toggle it to Active.

Related AI workflows

More from Jordi Faber

Need this deployed? We'll set it up for you.

Our automation experts deploy this workflow in your stack, connect your accounts, and verify it works — or build a custom solution from scratch.