Skip to content

Golang to generate and verify Google Authenticator 2-factor authentication

Notifications You must be signed in to change notification settings

mix-go/authenticator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Developed by OpenMix: https://openmix.org

Mix Authenticator

Install

go get github.com/mix-go/authenticator@latest

Generate Secret

secret := authenticator.GenerateSecret()

Generate Code

code := authenticator.GenerateToken(secret)

Verify Code

ok := authenticator.VerifyToken(secret, code)
// or
ok := authenticator.VerifyTokenCustom(secret, code, 60)

Generate Url

uri := authenticator.GenerateTotpUri("Foo", "bar", secret)
// or
url := authenticator.GenerateQRCodeGoogleUrl("Foo", "bar", secret)

License

Apache License Version 2.0, http://www.apache.org/licenses/

About

Golang to generate and verify Google Authenticator 2-factor authentication

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages