FluxyAPIFluxyAPI
BlocksTokens & Crypto

Generate Token

Create a secure, random string for authentication or identification.

The Generate Token block allows you to create a customizable, random string. This is commonly used for generating session IDs, API keys, password reset tokens, or unique identifiers.

Configuration

FieldRequiredDescription
Token LengthThe number of characters for the generated token (6 to 365).
Token CharsetChoose the characters to include: numbers, lowercase, uppercase, and symbols.
Token VariableThe name of the variable that will store the generated token (e.g., session_token).
Security Tip

For high-security tokens like API keys, use a length of at least 32 characters and include all charsets.

Error Handling

  • GENERATE_TOKEN_LENGTH_INVALID — Triggered when the length is not between 6 and 365.
  • GENERATE_TOKEN_CHARSET_INVALID — Triggered when no character set is selected.
  • GENERATE_TOKEN_VARIABLE_INVALID — Triggered when the output variable name is missing.
  • GENERATE_TOKEN_RUNTIME_ERROR — Triggered if an unexpected error occurs during generation.

Example: Creating a Password Reset Token

When a user requests a password reset, you can generate a secure 48-character token to include in their reset link.

  1. Token Length: Set to 48.
  2. Token Charset: Select numbers, lowercase, and uppercase.
  3. Token Variable: Enter reset_token.
  4. Result: The variable {reset_token} now contains a value like 8k2mN9PqL1vX7zW....

You can then save this {reset_token} to your database and send it to the user via email.

On this page