Documentation ¶
Overview ¶
Package mfa provides wrappers to add multi-factor authentication to any auth backend.
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 ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MFAPaths ¶
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 ¶
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.