tfa

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: MPL-2.0, MPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleTfaAndGetDeviceID

func HandleTfaAndGetDeviceID(signResponse *u2f.SignResponse, tfaMethod, totpCode, userID, clientIP, appName, timezone, orgName, orgID string) (deviceID string, reason consts.FailedReason, ok bool)

HandleTfaAndGetDeviceID handles all 2fa process, update device hygiene from u2f and return device ID of 2fa device

func SendU2F

func SendU2F(userID, orgID, appName, ip string) (bool, string)

Deprecated Use HandleTfaAndGetDeviceID instead

func SignReq

func SignReq(userID, orgID string) (*u2f.WebSignRequest, error)

SignReq is used by TfaHandler

func SignResp

func SignResp(signResp *u2f.SignResponse, keyval, challengeJson string) error

SignResp is U2F sign response function that can be used where signing function needs to be called within other functions

func U2fHandler

func U2fHandler(w http.ResponseWriter, r *http.Request)

U2f handler

func VerifyTotpCode

func VerifyTotpCode(totpCode, userID, orgID string) (bool, string, error)

returns check,deviceID and error

Types

type U2f

type U2f struct {
	AppName    string `json:"appSecret"`
	Answer     string `json:"answer"`
	Challenge  string `json:"challenge"`
	DeviceID   string `json:"deviceId"`
	Signature  string `json:"signature"`
	DeviceInfo string `json:"deviceInfo"`
	// contains filtered or unexported fields
}

todo check if fields are correct

Jump to

Keyboard shortcuts

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