A Sinatra REST API wrapping the ROTP library, to allow other applications to more easily plug in Time-Based One-Time Passwords (TOTP) for multi-factor authentication.
For production purposes, please only expose this service over HTTPS, or via local network as the shared secret is passed as a parameter to the service. If the shared secret is compromised, an attacker could easily generate the correct code and bypass this layer of security.
Fork this repository and then run Bundler to pull the required dependencies:
To start up:
Creates a new base32 token for you to store as a secret key.
Creates a QR code as a PNG containing:
Verifies that a user-provided code matches the expected value for the shared secret. Returns a text value of “true” or “false”.
Get the current time-based code for a given secret.
Returns the string “Up and running”, with the current date/time for verification.
New Code Timer