Documentation ¶
Index ¶
- func AuthAsync() func(*url.Values)
- func AuthDevice(device string) func(*url.Values)
- func AuthDisplayUsername(username string) func(*url.Values)
- func AuthIpAddr(ip string) func(*url.Values)
- func AuthPasscode(passcode string) func(*url.Values)
- func AuthPushinfo(pushinfo string) func(*url.Values)
- func AuthType(type_ string) func(*url.Values)
- func AuthUserId(userid string) func(*url.Values)
- func AuthUsername(username string) func(*url.Values)
- func EnrollUsername(username string) func(*url.Values)
- func EnrollValidSeconds(secs uint64) func(*url.Values)
- func PreauthIpAddr(ip string) func(*url.Values)
- func PreauthTrustedToken(trustedtoken string) func(*url.Values)
- func PreauthUserId(userid string) func(*url.Values)
- func PreauthUsername(username string) func(*url.Values)
- type AuthApi
- func (api *AuthApi) Auth(factor string, options ...func(*url.Values)) (*AuthResult, error)
- func (api *AuthApi) AuthStatus(txid string) (*AuthStatusResult, error)
- func (api *AuthApi) Check() (*CheckResult, error)
- func (api *AuthApi) Enroll(options ...func(*url.Values)) (*EnrollResult, error)
- func (api *AuthApi) EnrollStatus(userid string, activationCode string) (*EnrollStatusResult, error)
- func (api *AuthApi) Logo() (*LogoResult, error)
- func (api *AuthApi) Ping() (*PingResult, error)
- func (api *AuthApi) Preauth(options ...func(*url.Values)) (*PreauthResult, error)
- type AuthResult
- type AuthStatusResult
- type CheckResult
- type EnrollResult
- type EnrollStatusResult
- type LogoResult
- type PingResult
- type PreauthResult
- type StatResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthDevice ¶
func AuthDisplayUsername ¶
func AuthIpAddr ¶
func AuthPasscode ¶
func AuthPushinfo ¶
func AuthUserId ¶
func AuthUsername ¶
func EnrollUsername ¶
Optional parameter for the Enroll method.
func EnrollValidSeconds ¶
Optional parameter for the Enroll method.
func PreauthIpAddr ¶
func PreauthTrustedToken ¶
func PreauthUserId ¶
func PreauthUsername ¶
Types ¶
type AuthApi ¶
type AuthApi struct {
// contains filtered or unexported fields
}
func NewAuthApi ¶
func NewAuthApi(api duoapi.DuoApi) *AuthApi
Build a new Duo Auth API object. api is a duoapi.DuoApi object used to make the Duo Rest API calls. Example: authapi.NewAuthApi(*duoapi.NewDuoApi(ikey,skey,host,userAgent,duoapi.SetTimeout(10*time.Second)))
func (*AuthApi) Auth ¶
Duo's Auth method. https://www.duosecurity.com/docs/authapi#/auth Factor must be one of 'auto', 'push', 'passcode', 'sms' or 'phone'. Use AuthUserId to specify the user_id. Use AuthUsername to speicy the username. You must specify either AuthUserId or AuthUsername, but not both. Use AuthIpAddr to include the client's IP address. Use AuthAsync to toggle whether the call blocks for the user's response or not. If used asynchronously, get the auth status with the AuthStatus method. When using factor 'push', use AuthDevice to specify the device ID to push to. When using factor 'push', use AuthType to display some extra auth text to the user. When using factor 'push', use AuthDisplayUsername to display some extra text to the user. When using factor 'push', use AuthPushInfo to include some URL-encoded key/value pairs to display to the user. When using factor 'passcode', use AuthPasscode to specify the passcode entered by the user. When using factor 'sms' or 'phone', use AuthDevice to specify which device should receive the SMS or phone call.
func (*AuthApi) AuthStatus ¶
func (api *AuthApi) AuthStatus(txid string) (*AuthStatusResult, error)
Duo's auth_status method. https://www.duosecurity.com/docs/authapi#/auth_status When using the Auth call in async mode, use this method to retrieve the result of the authentication attempt. txid is returned by the Auth call.
func (*AuthApi) Check ¶
func (api *AuthApi) Check() (*CheckResult, error)
Call Duo's Check method. https://www.duosecurity.com/docs/authapi#/check Check is a signed Duo API call, which returns the Duo system's time. Use this method to determine whether your ikey, skey and host are correct, and whether your system time is in sync with Duo's.
func (*AuthApi) Enroll ¶
func (api *AuthApi) Enroll(options ...func(*url.Values)) (*EnrollResult, error)
Duo's Enroll method. https://www.duosecurity.com/docs/authapi#/enroll Use EnrollUsername() to include the optional username parameter. Use EnrollValidSeconds() to change the default validation time limit that the user has to complete enrollment.
func (*AuthApi) EnrollStatus ¶
func (api *AuthApi) EnrollStatus(userid string, activationCode string) (*EnrollStatusResult, error)
Duo's EnrollStatus method. https://www.duosecurity.com/docs/authapi#/enroll_status Return the status of an outstanding Enrollment.
func (*AuthApi) Logo ¶
func (api *AuthApi) Logo() (*LogoResult, error)
Duo's Logo method. https://www.duosecurity.com/docs/authapi#/logo If the API call is successful, the configured logo png is returned. Othwerwise, error information is returned in the LogoResult return value.
func (*AuthApi) Ping ¶
func (api *AuthApi) Ping() (*PingResult, error)
Duo's Ping method. https://www.duosecurity.com/docs/authapi#/ping This is an unsigned Duo Rest API call which returns the Duo system's time. Use this method to determine whether your system time is in sync with Duo's.
func (*AuthApi) Preauth ¶
func (api *AuthApi) Preauth(options ...func(*url.Values)) (*PreauthResult, error)
Duo's Preauth method. https://www.duosecurity.com/docs/authapi#/preauth options Optional values to include in the preauth call. Use PreauthUserId to specify the user_id parameter. Use PreauthUsername to specify the username parameter. You must specify PreauthUserId or PreauthUsername, but not both. Use PreauthIpAddr to include the ipaddr parameter, the ip address of the client attempting authroization. Use PreauthTrustedToken to specify the trusted_device_token parameter.
type AuthResult ¶
type AuthResult struct { StatResult Response struct { // Synchronous Result string Status string Status_Msg string // Asynchronous Txid string } }
Auth return type.
type AuthStatusResult ¶
type AuthStatusResult struct { StatResult Response struct { Result string Status string Status_Msg string Trusted_Device_Token string } }
AuthStatus return type.
type CheckResult ¶
type CheckResult struct { StatResult Response struct { Time int64 } }
Return object for the 'Check' API call.
type EnrollResult ¶
type EnrollResult struct { StatResult Response struct { Activation_Barcode string Activation_Code string Expiration int64 User_Id string Username string } }
Enroll return type.
type EnrollStatusResult ¶
type EnrollStatusResult struct { StatResult Response string }
Response is "success", "invalid" or "waiting".
type LogoResult ¶
type LogoResult struct { StatResult // contains filtered or unexported fields }
Return object for the 'Logo' API call.
type PingResult ¶
type PingResult struct { StatResult Response struct { Time int64 } }
Return object for the 'Ping' API call.