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 secretThe key to use (raw byte value)
STRING accountThe name of the user's account (may be left empty)
STRING issuerThe name of the issuer of the secret (may be left empty)
INTEGER64 counterThe counter value to start from
RECORD optionsOptions
INTEGER digitsThe length of the resulting password, range [6-8], defaults to 6
STRING hmacThe HMAC algorithm to use, defaults to "HMAC:SHA-1"
Return value
STRINGThe 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.