---
title: HOTP Generator node
description: The HOTP Generator node creates a string of random digits of the specified length for use as a one-time passcode (OTP).
component: auth-node-ref
version: latest
page_id: auth-node-ref::hotp-generator
canonical_url: https://docs.pingidentity.com/auth-node-ref/latest/hotp-generator.html
keywords: ["Nodes &amp; Trees", "Journeys", "Authentication", "Passwords"]
page_aliases: ["auth-node-hotp-generator.adoc"]
superseded_by: https://docs.pingidentity.com/auth-node-ref/latest/hotp-generator.html
section_ids:
  figure-trees-hotp-example: Example
  availability: Availability
  inputs: Inputs
  dependencies: Dependencies
  configuration: Configuration
  outputs: Outputs
  callbacks: Callbacks
  outcomes: Outcomes
  errors: Errors
---

# HOTP Generator node

The HOTP Generator node creates a string of random digits of the specified length for use as a one-time passcode (OTP).

## Example

The following example demonstrates using an OTP in a multi-factor authentication journey:

![OTP journey](_images/otp-example-journey.png)

* The [Page node](page.html) containing the [Platform Username node](platform-username.html) and [Platform Password node](platform-password.html) prompts for credentials.

* The [Data Store Decision node](data-store-decision.html) validates the username-password credentials.

* The [HOTP Generator node](hotp-generator.html) generates an eight-digit OTP.

* The [Choice Collector node](choice-collector.html) prompts the user to choose whether they want to receive the OTP via email or SMS.

  * If the user chooses email, the [OTP Email Sender node](otp-email-sender.html) sends the OTP to the user's email address.

  * If the user chooses SMS, the [OTP SMS Sender node](otp-sms-sender.html) sends the OTP to the user's mobile number.

* The [OTP Collector Decision node](otp-collector-decision.html) prompts the user to enter the OTP they received and verifies it. If the OTP is correct, the user is authenticated.

## Availability

| Product                               | Available? |
| ------------------------------------- | ---------- |
| PingOne Advanced Identity Cloud       | Yes        |
| PingAM (self-managed)                 | Yes        |
| Ping Identity Platform (self-managed) | Yes        |

## Inputs

None. This node doesn't read shared state data.

## Dependencies

This node has no dependencies.

## Configuration

| Property                 | Usage                                                                                                                                                                       |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| One Time Password Length | The number of digits in the OTP. The minimum number of digits is 6, in accordance with the [HOTP specification](https://datatracker.ietf.org/doc/html/rfc4226).Default: `8` |

## Outputs

The node adds the generated OTP and the time it was created to the `oneTimePassword` and `oneTimePasswordTimestamp` shared state attributes respectively.

## Callbacks

This node doesn't send any callbacks.

## Outcomes

Single outcome path.

Implement an [OTP Email Sender node](otp-email-sender.html) or an [OTP SMS Sender node](otp-sms-sender.html) after this node to send the generated OTP to the user.

## Errors

If the node fails to generate an OTP, it logs an `Error generating HOTP password` warning message.
