mfa

package
v2.0.0-rc1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxOpenRetries = 10
	RetryDelayMS   = 200 * time.Millisecond
)
View Source
const (
	ActionVerify = "verify"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DUODevice

type DUODevice struct {
	DeviceName string
	// contains filtered or unexported fields
}

DUODevice is implementation of MFADevice for SMS

func (*DUODevice) Supports

func (d *DUODevice) Supports(factorType, factorProvider string) bool

Supported will check if the mfa config can be used by this device

func (*DUODevice) Verify

func (d *DUODevice) Verify(authResp marshal.UserAuthn) (string, interface{}, error)

Verify is called to get generate the payload that will be sent to Okta.

We will call this twice, once to tell Okta to send the code then
Once to prompt the user using `CodeSupplier` for the code.

type ErrUnknownStatus

type ErrUnknownStatus struct {
	Status string
}

func (*ErrUnknownStatus) Error

func (e *ErrUnknownStatus) Error() string

type FIDODevice

type FIDODevice struct {
}

FIDODevice is implementation of MFADevice for SMS

func (*FIDODevice) Supports

func (d *FIDODevice) Supports(factorType string, factorProvider string) bool

func (*FIDODevice) Verify

func (d *FIDODevice) Verify(authResp marshal.UserAuthn) (string, interface{}, error)

payload may be a Payload, or a SignedAssertion

type FidoClient

type FidoClient struct {
	ChallengeNonce string
	AppId          string
	Version        string
	Device         u2fhost.Device
	KeyHandle      string
	StateToken     string
}

func NewFidoClient

func NewFidoClient(challengeNonce, appId, version, keyHandle, stateToken string) (FidoClient, error)

func (*FidoClient) ChallengeU2f

func (d *FidoClient) ChallengeU2f() (*SignedAssertion, error)

type Input

type Input interface {
	CodeSupplier(factorType string) (string, error)
}

Input is provided to get input from the user.

type Payload

type Payload struct {
	StateToken string `json:"stateToken"`
	PassCode   string `json:"passCode,omitempty"`
}

Payload is a common request body that is sent as part of mfa validation

type SMSDevice

type SMSDevice struct {
	// contains filtered or unexported fields
}

SMSDevice is implementation of MFADevice for SMS

func (*SMSDevice) Support

func (d *SMSDevice) Support(factorType string, factorProvider string) bool

Supported will check if the mfa config can be used by this device

func (*SMSDevice) Verify

func (d *SMSDevice) Verify(authResp marshal.UserAuthn) (string, interface{}, error)

Verify is called to get generate the payload that will be sent to Okta.

We will call this twice, once to tell Okta to send the code then
Once to prompt the user using `CodeSupplier` for the code.

type SignedAssertion

type SignedAssertion struct {
	StateToken    string `json:"stateToken"`
	ClientData    string `json:"clientData"`
	SignatureData string `json:"signatureData"`
}

type TOTPDevice

type TOTPDevice struct {
	// contains filtered or unexported fields
}

TOTPDevice is the implementation of MFADevice

func (*TOTPDevice) Supports

func (d *TOTPDevice) Supports(factorType string, factorProvider string) bool

func (*TOTPDevice) Verify

func (d *TOTPDevice) Verify(authResp marshal.UserAuthn) (string, interface{}, error)

Verify will prompt the user for a code then return the payload for verification

Directories

Path Synopsis
internal
duoclient
TODO refactor?
TODO refactor?

Jump to

Keyboard shortcuts

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