auth

package
v0.0.0-...-95be442 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TwoStepAuthGenNumber

func TwoStepAuthGenNumber(t *TOTP) (string, int64, error)

TwoStepAuthGenNumber 根据提供的 secret 来生成6位数字 返回 6位数字、剩余时间

Types

type JWToken

type JWToken struct {
	SignString string
}

JWToken jwt token

func NewJWToken

func NewJWToken(signString string) *JWToken

NewJWToken 创建JWToken对象

func (*JWToken) GenJWToken

func (t *JWToken) GenJWToken(rawContent map[string]interface{}) (string, error)

GenJWToken 生成一个jwt token

func (*JWToken) ParseJWToken

func (t *JWToken) ParseJWToken(tokenString string) (map[string]interface{}, error)

ParseJWToken 解析 JWToken

type TOTP

type TOTP struct {
	SecretKey string // secret
	Algorithm string // 加密算法
	Issuer    string // 发行者
	Name      string // 名称
	Digits    int    // 位数
}

func TwoStepAuthParseQRCode

func TwoStepAuthParseQRCode(qrcodePath string) (*TOTP, error)

TwoStepAuthGenByQRCode 解析二维码图片

Jump to

Keyboard shortcuts

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