GetHOTPUrl (open)

Create a url which encodes the HOTP secret for use in external applications

Syntax

LOADLIB "wh::util/otp.whlib";

STRING FUNCTION GetHOTPUrl(STRING secret, STRING account, STRING issuer, INTEGER64 counter, RECORD options)

Parameters

STRING secret

The key to use (raw byte value)

STRING account

The name of the user's account (may be left empty)

STRING issuer

The name of the issuer of the secret (may be left empty)

INTEGER64 counter

The counter value to start from

RECORD options

Options

INTEGER digits

The length of the resulting password, range [6-8], defaults to 6

STRING hmac

The HMAC algorithm to use, defaults to "HMAC:SHA-1"

Return value

STRING

The url that can be used in external applications (for example by encoding it in a scannable QR code)

Description

This function creates a URL that can be used by external applications to initialize HOTP authentication. This URL can be used to create a QR code that can be scanned by such applications. Please note that external applications may not support all of the options and will fallback to the defaults.