Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrDuoServer = errors.New("duo: server error")
ErrDuoServer is returned when an error is returned by the Duo servers for an unknown reason.
var ErrMethodNotSupported = errors.New("duo: method not supported")
ErrMethodNotSupported is returned when an attempt is made to use a Method that is currently not supported.
Functions ¶
This section is empty.
Types ¶
type Challenge ¶
type Challenge struct { Devices []Device Methods []Method // contains filtered or unexported fields }
An Challenge is a 2FA request from Duo.
func BeginChallenge ¶
func BeginChallenge(c *http.Client, parent string, host string, sigRequest string, postAction string) (*Challenge, error)
BeginChallenge starts handling a Duo authentication request.
func (*Challenge) StartMethod ¶
func (c *Challenge) StartMethod(method *Method) (*StatusResponse, error)
StartMethod starts the authentication process with the given Method.
func (*Challenge) WaitForCompletion ¶
func (c *Challenge) WaitForCompletion() (*FinalResponse, *ChallengeResponse, error)
WaitForCompletion waits for the Challenge's authentication process to complete.
type ChallengeResponse ¶
type ChallengeResponse struct { StatusCode string `json:"status_code"` Result string `json:"result"` ResultURL string `json:"result_url"` Parent string `json:"parent"` Reason string `json:"reason"` Status string `json:"status"` }
A ChallengeResponse is returned after a Challenge's Method is completed.
type FinalResponse ¶
A FinalResponse is returned after a Challenge is completed, and it can be used to finish the authentication process.
type StatusResponse ¶
A StatusResponse is returned after a Challenge's Method is started.