okta

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YAK_STATUS_OK           = iota
	YAK_STATUS_UNAUTHORISED = iota
	YAK_STATUS_DATA_ERROR   = iota
	YAK_STATUS_NET_ERROR    = iota
	YAK_STATUS_BAD_RESPONSE = iota
)

Variables

This section is empty.

Functions

func AwsSamlLogin

func AwsSamlLogin(oktaHref string, samlHref string, oktasession OktaSession) (string, error)

func TotpFactorName added in v1.1.3

func TotpFactorName(key string) string

Types

type AuthResponseEmbedded

type AuthResponseEmbedded struct {
	Factors []AuthResponseFactor `json:"factors"`
}

type AuthResponseFactor

type AuthResponseFactor struct {
	Links      AuthResponseFactorLinks `json:"_links"`
	FactorType string                  `json:"factorType"`
	Provider   string                  `json:"provider"`
}
type AuthResponseFactorLinks struct {
	VerifyLink OktaLink `json:"verify"`
}

type OktaAuthResponse

type OktaAuthResponse struct {
	StateToken    string               `json:"stateToken"`
	SessionToken  string               `json:"sessionToken"`
	ExpiresAt     string               `json:"expiresAt"`
	Status        string               `json:"status"`
	Embedded      AuthResponseEmbedded `json:"_embedded"`
	YakStatusCode int
}

func Authenticate

func Authenticate(oktaHref string, userData UserData) (OktaAuthResponse, error)

func VerifyPush added in v1.3.1

func VerifyPush(url string, pushRequestBody PushRequest) (OktaAuthResponse, error)

func VerifyTotp

func VerifyTotp(url string, totpRequestBody TotpRequest) (OktaAuthResponse, error)
type OktaLink struct {
	Href string `json:"href"`
}

type OktaSession added in v1.5.7

type OktaSession struct {
	Id        string    `json:"id"`
	ExpiresAt time.Time `json:"expiresAt"`
}

func CreateSession added in v1.5.7

func CreateSession(oktaHref string, authResponse OktaAuthResponse) (*OktaSession, error)

TODO: DRY

func GetSession added in v1.5.7

func GetSession(oktaHref string, session *OktaSession) (*OktaSession, error)

TODO: DRY

type PushRequest added in v1.3.1

type PushRequest struct {
	StateToken string `json:"stateToken"`
}

type PushRequestResponse added in v1.3.1

type PushRequestResponse struct {
	Links        PushRequestResponseLinks `json:"_links"`
	FactorResult string                   `json:"factorResult"`
}
type PushRequestResponseLinks struct {
	PollLink OktaLink `json:"next"`
}

type TotpRequest

type TotpRequest struct {
	StateToken string `json:"stateToken"`
	PassCode   string `json:"passCode"`
}

type UserData

type UserData struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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