Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 661 Bytes

README.md

File metadata and controls

41 lines (28 loc) · 661 Bytes

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/