vault: github.com/hashicorp/vault/helper/mfa Index | Files | Directories

package mfa

import "github.com/hashicorp/vault/helper/mfa"

Package mfa provides wrappers to add multi-factor authentication to any auth method.

To add MFA to a backend, replace its login path with the paths returned by MFAPaths and add the additional root paths returned by MFARootPaths. The backend provides the username to the MFA wrapper in Auth.Metadata['username'].

To add an additional MFA type, create a subpackage that implements [Type]Paths, [Type]RootPaths, and [Type]Handler functions and add them to MFAPaths, MFARootPaths, and handlers respectively.

Index

Package Files

mfa.go path_mfa_config.go

func MFAPaths Uses

func MFAPaths(originalBackend *framework.Backend, loginPath *framework.Path) []*framework.Path

MFAPaths returns paths to wrap the original login path and configure MFA. When adding MFA to a backend, these paths should be included instead of the login path in Backend.Paths.

func MFARootPaths Uses

func MFARootPaths() []string

MFARootPaths returns path strings used to configure MFA. When adding MFA to a backend, these paths should be included in Backend.PathsSpecial.Root.

type HandlerFunc Uses

type HandlerFunc func(context.Context, *logical.Request, *framework.FieldData, *logical.Response) (*logical.Response, error)

HandlerFunc is the callback called to handle MFA for a login request.

type MFAConfig Uses

type MFAConfig struct {
    Type string `json:"type"`
}

Directories

PathSynopsis
duoPackage duo provides a Duo MFA handler to authenticate users with Duo.

Package mfa imports 4 packages (graph) and is imported by 44 packages. Updated 2019-04-16. Refresh now. Tools for package owners.