mfa

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2018 License: CC0-1.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Log api.LogService
	Env api.Settings
}

Service implements a multiple factor authentication.

func (Service) Authenticate

func (service Service) Authenticate(token, secret string) (ok bool, err error)

Authenticate validates the initial token generated when configuring two-factor authentication for the first time.

func (Service) Generate

func (service Service) Generate(account, secret string) (string, error)

Generate will create a QR code in PNG format which will then be base64 encoded so it can traverse the wire to the front end.

func (Service) Secret

func (service Service) Secret() string

Secret creates a random secret and then base32 encodes it.

Jump to

Keyboard shortcuts

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