Skip to content

manuwell/guardian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Guardian server for TOTP

Validates a given token for your account.

The current routes are:

  # generate and configure new TOTP
  POST /token

  # check google-authenticator token against the secret on the server
  GET  /token/check/:token

Installation

Download the latest release of guardian

See .env.sample to see what env vars you need to set. After setting those env vars, just run:

bin/guardian

Usage

Creating new token for google-authenticator using curl:

  • Download your TOTP key credential
curl -XPOST -u user:pass -o guardian.html http://localhost:9222/token -d"issuer=stark.inc&[email protected]"
  • open the downloaded file guardian.html in your favorite browser and you should see: credential

  • Open your google-authenticator and point the app to the generated QRCode

  • Your guardian server is now configured with the generated secret in your guardian.html file

  • To check the token generated by google-authenticator app just curl the url:

curl -u user:pass http://localhost:9222/token/check/GENERATED_TOKEN
# response
{
  "Valid": true,
}