Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidOTP is an error to be returned if the supplied OTP code is not valid. ErrInvalidOTP = fmt.Errorf("invalid otp code format") // Window OTP validity stepping window. Set this between 2 to 6. Above that is not secure Window = 3 )
Functions ¶
func Authenticate ¶
Authenticate will validate the supplied OTP toward user's secrets.
Types ¶
type Secret ¶
type Secret []byte
Secret is a secret data that represent user's secret.
func MakeSecret ¶
func MakeSecret() Secret
MakeSecret will create a random 10 bytes (80 bits) secret.
func SecretFromBase32 ¶
SecretFromBase32 will create a secret data from its base32 format.
func (Secret) Base32 ¶
Base32 will create the Base32 string representation of this secret (eg. for storing into db)
func (Secret) ProvisionURL ¶
ProvisionURL will create provisioning URL to be generated into QR or Bar Codes. https://github.com/google/google-authenticator/wiki/Key-Uri-Format
Click to show internal directories.
Click to hide internal directories.