Skip to content

maurodelazeri/google-authenticator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

google-authenticator

Generate Google Authentication Codes with golang

go get github.com/maurodelazeri/google-authenticator

Insert into the secret file the secret generated by your counterpart

package main

import (
	"io/ioutil"
	"log"
	"os"

	"github.com/maurodelazeri/google-authenticator"
)

func main() {
	data, err := ioutil.ReadFile("secret")
	if err != nil {
		log.Print(err)
		os.Exit(1)
	}
	secret := string(data)
	otp := authenticator.GetTOTPToken(secret)
	log.Printf(otp)
}
$ go run main.go
2018/11/29 08:43:50 153071

About

Generate Google Authentication Codes with golang

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages