Skip to content

Totp ‚Äč

The TOTP module can be used to generate one-time passcodes as specified in RFC6238. It uses the same algorithm as Google Authenticator etc so it should be compatible with the codes generated there. The use-cases it is meant for is e.g. using Manatee for logging into 2FA enabled sites and a concrete case was @lykke s Swedish RPA setup for logging into his machines using the Bomgar tool.

An example is given below;

// Load and instantiate the module
var totp = Module.load("Totp", { version: "v1.0.1" });
// You use the code given in the 2FA signup (where the QR code is also normally shown)
var passcode = totp.generate("G3PV4MGQ74S4NRWWBHCCFDS572ACXOC4");

where G3PV4MGQ74S4NRWWBHCCFDS572ACXOC4 is the secret code given when you sign up for 2FA auth. This needs to be stored somewhere, e.g. directly in the flow or maybe encrypted in a Table and then used each time you need to generate a new passcode for login.

Initial release.