okta

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package okta contains functionality for interacting with the Okta REST API.

Index

Constants

View Source
const (
	AuthExceptionCode            = "E000004"
	OktaAPIBaseURL               = "https://%s.okta.com/api/v1"
	PasswordExpiredExceptionCode = "E000064"
	PasswordExpiredSummary       = "Password is expired and must be changed."
)

API constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct{}

Client is a client for making Okta API requests.

func NewClient

func NewClient() *Client

NewClient returns a new Client object.

func (*Client) Authenticate

func (c *Client) Authenticate(req *util.OpenVPNClientRequest) error

Authenticate attempts to authenticate the user credentials in the client request using the Okta API.

The following errors are returned by this function: OktaRequestFailure, OktaResponseFailure, OktaAuthFailure

type EmbeddedResource

type EmbeddedResource struct {
	User    UserObject     `json:"user"`
	Factors []FactorObject `json:"factors"`
	Policy  PolicyObject   `json:"policy"`
}

EmbeddedResource contains embedded resource information.

type ErrorResponse

type ErrorResponse struct {
	ErrorCode    string          `json:"errorCode"`
	ErrorSummary string          `json:"errorSummary"`
	ErrorLink    string          `json:"errorLink"`
	ErrorID      string          `json:"errorId"`
	ErrorCauses  []ErrorResponse `json:"errorCauses"`
}

ErrorResponse contains error information when a REST authentication request fails.

type FactorObject

type FactorObject struct {
	ID         string                  `json:"id"`
	FactorType string                  `json:"factorType"`
	Provider   string                  `json:"provider"`
	VendorName string                  `json:"vendorsName"`
	Profile    json.RawMessage         `json:"profile"`
	Links      map[string]LinkResource `json:"_links"`
}

FactorObject contains information about a particular MFA factor.

type LinkResource

type LinkResource struct {
	Href  string              `json:"href"`
	Hints map[string][]string `json:"hints"`
}

LinkResource describes links to other resources or API calls.

type PolicyObject

type PolicyObject struct {
	AllowRememberDevice             bool            `json:"allowRememberDevice"`
	RememberDeviceLifetimeInMinutes uint32          `json:"rememberDeviceLifetimeInMinutes"`
	RememberDeviceByDefault         bool            `json:"rememberDeviceByDefault"`
	FactorsPolicyInfo               json.RawMessage `json:"factorsPolicyInfo"`
}

PolicyObject contains policy information.

type PrimaryAuthResponse

type PrimaryAuthResponse struct {
	StateToken string                  `json:"stateToken"`
	ExpiresAt  string                  `json:"expiresAt"`
	Status     string                  `json:"status"`
	Embedded   EmbeddedResource        `json:"_embedded"`
	Links      map[string]LinkResource `json:"_links"`
}

PrimaryAuthResponse contains primary authentication information when authentication succeeds.

type SecondaryAuthResponse

type SecondaryAuthResponse struct {
	ExpiresAt    string `json:"expiresAt"`
	Status       string `json:"status"`
	FactorResult string `json:"factorResult"`
	SessionToken string `json:"sessionToken"`
}

SecondaryAuthResponse contains secondary authentication information when MFA succeeds.

type UserObject

type UserObject struct {
	ID              string      `json:"id"`
	PasswordChanged string      `json:"passwordChanged"`
	Profile         UserProfile `json:"profile"`
}

UserObject holds information about a user.

type UserProfile

type UserProfile struct {
	Login     string `json:"login"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Locale    string `json:"locale"`
	TimeZone  string `json:"timeZone"`
}

UserProfile holds user profile information such as login, first and last name, etc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL