Documentation ¶
Index ¶
- type AccessDeviceInfo
- type ApplicationInfo
- type AuthContextInfo
- type AuthDeviceInfo
- type AuthResultInfo
- type BodyToken
- type Client
- func (client *Client) CreateAuthURL(username string, state string) (string, error)
- func (client *Client) ExchangeAuthorizationCodeFor2faResult(duoCode string, username string) (*TokenResponse, error)
- func (client *Client) ExchangeAuthorizationCodeFor2faResultWithNonce(duoCode string, username string, nonce string) (*TokenResponse, error)
- func (client *Client) GenerateState() (string, error)
- func (client *Client) GenerateStateWithLength(length int) (string, error)
- func (client *Client) HealthCheck() (*HealthCheckResponse, error)
- type FlagStatus
- type HealthCheckResponse
- type HealthCheckTime
- type LocationInfo
- type MapClaims
- type TokenResponse
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessDeviceInfo ¶
type AccessDeviceInfo struct { Browser string `json:"browser"` BrowserVersion string `json:"browser_version"` FlashVersion string `json:"flash_version"` Hostname string `json:"host_name"` Ip string `json:"ip"` IsEncryptionEnabled FlagStatus `json:"is_encryption_enabled"` IsFirewallEnabled FlagStatus `json:"is_firewall_enabled"` IsPasswordSet FlagStatus `json:"is_password_set"` JavaVersion string `json:"java_version"` Location LocationInfo `json:"location"` Os string `json:"os"` OsVersion string `json:"os_version"` }
type ApplicationInfo ¶
type AuthContextInfo ¶
type AuthContextInfo struct { AccessDevice AccessDeviceInfo `json:"access_device"` Alias string `json:"alias"` Application ApplicationInfo `json:"application"` AuthDevice AuthDeviceInfo `json:"auth_device"` Email string `json:"email"` EventType string `json:"event_type"` Factor string `json:"factor"` Isotimestamp string `json:"isotimestamp"` OodSoftware string `json:"ood_software"` Reason string `json:"reason"` Result string `json:"result"` Timestamp int `json:"timestamp"` Txid string `json:"txid"` User UserInfo `json:"user"` }
type AuthDeviceInfo ¶
type AuthDeviceInfo struct { Ip string `json:"ip"` Location LocationInfo `json:"location"` Name string `json:"name"` }
type AuthResultInfo ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientDuoCodeAttribute ¶
func NewClientDuoCodeAttribute(clientId, clientSecret, apiHost, redirectUri string, useDuoCodeAttribute bool) (*Client, error)
Creates a new Client with the ability to turn off use_duo_code_attribute
func (*Client) CreateAuthURL ¶
func (*Client) ExchangeAuthorizationCodeFor2faResult ¶
func (client *Client) ExchangeAuthorizationCodeFor2faResult(duoCode string, username string) (*TokenResponse, error)
func (*Client) ExchangeAuthorizationCodeFor2faResultWithNonce ¶
func (client *Client) ExchangeAuthorizationCodeFor2faResultWithNonce(duoCode string, username string, nonce string) (*TokenResponse, error)
Exchange the duo_code for a token with Duo to determine if the auth was successful.
func (*Client) GenerateState ¶
Return a cryptographically-secure string of random characters with the default length
func (*Client) GenerateStateWithLength ¶
Return a cryptographically-secure string of random characters suitable for use in state values. length is the number of characters in the randomly generated string
func (*Client) HealthCheck ¶
func (client *Client) HealthCheck() (*HealthCheckResponse, error)
Checks whether or not Duo is available.
type FlagStatus ¶ added in v1.0.2
type FlagStatus int32
const ( Disabled FlagStatus = iota Enabled Unknown = 99 )
func (FlagStatus) MarshalJSON ¶ added in v1.0.2
func (f FlagStatus) MarshalJSON() ([]byte, error)
func (*FlagStatus) UnmarshalJSON ¶ added in v1.0.2
func (f *FlagStatus) UnmarshalJSON(data []byte) error
type HealthCheckResponse ¶
type HealthCheckResponse struct { Stat string `json:"stat"` Message string `json:"message"` MessageDetail string `json:"message_detail"` Response HealthCheckTime `json:"response"` Code int `json:"code"` }
type HealthCheckTime ¶
type HealthCheckTime struct {
Time int `json:"time"`
}
type LocationInfo ¶
type TokenResponse ¶
type TokenResponse struct { PreferredUsername string `json:"preferred_username"` AuthTime int `json:"auth_time"` Nonce string `json:"nonce"` AuthResult AuthResultInfo `json:"auth_result"` AuthContext AuthContextInfo `json:"auth_context"` Audience string `json:"aud"` ExpiresAt int64 `json:"exp"` Id string `json:"jti"` IssuedAt int64 `json:"iat"` Issuer string `json:"iss"` Subject string `json:"sub"` }
Click to show internal directories.
Click to hide internal directories.