Skip to main content

Function: generateTOTPURI()

generateTOTPURI(config, label, secret): Promise<string>

Defined in: src/auth/shared.ts:495

Generates an otpauth:// provisioning URI for the given TOTP secret — the "Key URI Format" convention (https://github.com/google/google-authenticator/wiki/Key-Uri-Format) that, while not itself an RFC, is the de facto standard virtually every TOTP authenticator app (Google Authenticator, Authy, 1Password, etc.) relies on to enroll a secret via QR code or manual entry.

Parameters

config

TOTPConfig

The relying party configuration to generate the URI for.

label

string

The account label to embed in the URI (typically a username or email).

secret

TOTPSecret

The TOTP secret to encode into the URI.

Returns

Promise<string>