services

package
v1.4.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateOTPSeed

func GenerateOTPSeed(digits int, algorithm string, skew uint, period uint, user core.IUser) (secret string, imagePath string)

func GetOTP

func GetOTP(seed string, digits int, algorithm string, skew uint, period uint) string

getOTP is a function that generates TOTP using github.com/pquerna/otp

Parameters:

  • seed: OTP seed is base32
  • digits: the number of digits for the OTP
  • algorithm: "sha1", "sha256", "sha512"
  • skew: the number of minutes to search around the OTP
  • period: the number of seconds for the OTP to change

func VerifyOTP

func VerifyOTP(pass, seed string, digits int, algorithm string, skew uint, period uint) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL