Ask AI
Skip to main content

Configure an OTP device

Function: Configure an OTP device​

This function allows you to link a new authenticator app or device to the currently logged-in user's account. This is typically used for setting up Two-Factor Authentication (2FA) to add an extra layer of security. You'll provide a name for the device and the one-time password (OTP) generated by your authenticator app.

Input​

  • Device name (STRING): The name you want to give to this authenticator device (e.g., "My Phone Authenticator", "Work Laptop"). This helps you identify it later. This input is required.
  • One time password (NUMBER): The 6-digit (or similar) code displayed in your authenticator app (like Google Authenticator, Authy, etc.) that you want to link. This input is required.

Output​

This function does not produce any direct output parameters. It performs an action to configure the user's account.

Execution Flow​

Real-Life Examples​

Here are some examples of how you might use the "Configure an OTP device" function:

  1. Setting up Two-Factor Authentication (2FA) for a new phone

    • Inputs:
      • Device name: "My New iPhone Authenticator"
      • One time password: 123456 (the code currently displayed on your new iPhone's authenticator app)
    • Result: The user's account is now secured with Two-Factor Authentication using the authenticator app on "My New iPhone Authenticator".
  2. Adding a backup authenticator device

    • Inputs:
      • Device name: "Backup Tablet Authenticator"
      • One time password: 987654 (the code from the authenticator app on your tablet)
    • Result: A second authenticator device named "Backup Tablet Authenticator" is linked to the user's account, providing an alternative for 2FA in case your primary device is unavailable.
  3. Re-configuring an existing authenticator after a reset

    • Inputs:
      • Device name: "Work Laptop Authenticator"
      • One time password: 456789 (the new code from your authenticator app after a reset or re-sync)
    • Result: The authenticator device named "Work Laptop Authenticator" is updated with the new one-time password, ensuring your 2FA continues to work correctly.