okta

package
v0.0.0-...-dc8a8ef Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSaml

func GetSaml(r io.Reader) (string, error)

Types

type OktaAppLink struct {
	Id            string `json:"id"`
	Label         string `json:"label"`
	LinkUrl       string `json:"linkUrl"`
	AppName       string `json:"appName"`
	AppInstanceId string `json:"appInstanceId"`
}

type OktaAuthFactors

type OktaAuthFactors struct {
	Id         string    `json:"id"`
	FactorType string    `json:"factorType"`
	Links      OktaLinks `json:"_links"`
}

type OktaAuthResponse

type OktaAuthResponse struct {
	ExpiresAt    time.Time                `json:"expiresAt"`
	SessionToken string                   `json:"sessionToken"`
	StateToken   string                   `json:"stateToken"`
	Status       string                   `json:"status"`
	Embedded     OktaAuthResponseEmbedded `json:"_embedded"`
}

type OktaAuthResponseEmbedded

type OktaAuthResponseEmbedded struct {
	Factors []OktaAuthFactors `json:"factors"`
}

type OktaClient

type OktaClient struct {
	HttpClient    *http.Client
	SessionCache  SessionCache
	ConsoleReader console.ConsoleReader
	BaseUrl       *url.URL
	Timeout       time.Duration
	Retries       int
}

func NewOktaClient

func NewOktaClient(org string, consolerw console.ConsoleReader) (*OktaClient, error)

func (*OktaClient) Authenticate

func (o *OktaClient) Authenticate(username, password, org, factor string) (string, error)

func (*OktaClient) AuthenticateFromCache

func (o *OktaClient) AuthenticateFromCache(username, org string) (string, bool)

func (*OktaClient) CacheOktaSession

func (o *OktaClient) CacheOktaSession(userId, org, sessionId, expiresAt string)

func (*OktaClient) ClearCachedOktaSession

func (o *OktaClient) ClearCachedOktaSession()

func (*OktaClient) GetCachedOktaSession

func (o *OktaClient) GetCachedOktaSession(userid, org string) (file.OktaSessionCache, bool)

func (*OktaClient) GetSaml

func (o *OktaClient) GetSaml(appLink OktaAppLink) (string, error)
func (o *OktaClient) ListAppLinks(userId string) ([]OktaAppLink, error)

func (*OktaClient) ListApplications

func (o *OktaClient) ListApplications(userId string) ([]OktaAppLink, error)
type OktaLinks struct {
	Verify OktaVerifyLink `json:"verify"`
}

type OktaMeResponse

type OktaMeResponse struct {
	Id string `json:"id"`
}

type OktaSessionResponse

type OktaSessionResponse struct {
	Id        string `json:"id"`
	UserId    string `json:"userId"`
	ExpiresAt string `json:"expiresAt"`
}

type OktaSessionsRequest

type OktaSessionsRequest struct {
	SessionToken string `json:"sessionToken"`
}
type OktaVerifyLink struct {
	Url string `json:"href"`
}

type SessionCache

type SessionCache interface {
	ClearSessions()
	SaveSessions(sessions []file.OktaSessionCache)
	Sessions() ([]file.OktaSessionCache, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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