sessiontoken

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthToken

type AuthToken struct {
	AccessToken string `json:"access_token,omitempty"`
	IDToken     string `json:"id_token,omitempty"`
	Scope       string `json:"scope,omitempty"`
}

AuthToken Encapsulates an Okta Token https://developer.okta.com/docs/reference/api/oidc/#token

type DeviceAuthorization

type DeviceAuthorization struct {
	UserCode                string `json:"user_code,omitempty"`
	DeviceCode              string `json:"device_code,omitempty"`
	VerificationURI         string `json:"verification_uri,omitempty"`
	VerificationURIComplete string `json:"verification_uri_complete,omitempty"`
	ExpiresIn               int    `json:"expires_in,omitempty"`
	Interval                int    `json:"interval,omitempty"`
}

DeviceAuthorization Encapsulates Okta API result to /oauth2/v1/device/authorize call

type IDPAndRole

type IDPAndRole struct {
	// contains filtered or unexported fields
}

IDPAndRole IdP and role pairs

type SessionToken

type SessionToken struct {
	// contains filtered or unexported fields
}

SessionToken Encapsulates the work of getting an AWS Session Token

func NewSessionToken

func NewSessionToken() (*SessionToken, error)

NewSessionToken Creates a new session token.

func (*SessionToken) EstablishToken

func (s *SessionToken) EstablishToken() error

EstablishToken Template method of the steps to establish an AWS session token.

func (*SessionToken) GetAWSCredential

func (s *SessionToken) GetAWSCredential(idpAndRole *IDPAndRole, assertion string) (*oaws.Credential, error)

GetAWSCredential Get AWS Credentials with an STS Assume Role With SAML AWS API call.

func (*SessionToken) GetAccessToken

func (s *SessionToken) GetAccessToken(deviceAuth *DeviceAuthorization) (*AuthToken, error)

GetAccessToken see: https://developer.okta.com/docs/reference/api/oidc/#token

func (*SessionToken) GetIDPRolesMapFromAssertion

func (s *SessionToken) GetIDPRolesMapFromAssertion(encoded string) (map[string][]string, error)

GetIDPRolesMapFromAssertion Get AWS IdP and Roles from SAML assertion. Result a map string string slice keyed by the IdP ARN value and slice of ARN role values.

func (*SessionToken) GetSAMLAssertion

func (s *SessionToken) GetSAMLAssertion(at *AuthToken) (string, error)

GetSAMLAssertion Gets the SAML assertion from Okta API /login/token/sso

func (*SessionToken) GetSSOToken

func (s *SessionToken) GetSSOToken(at *AuthToken) (*AuthToken, error)

GetSSOToken see: https://developer.okta.com/docs/reference/api/oidc/#token

func (*SessionToken) PromptAuthentication

func (s *SessionToken) PromptAuthentication(da *DeviceAuthorization)

PromptAuthentication UX to display activation URL and code.

func (*SessionToken) PromptForIdpAndRole

func (s *SessionToken) PromptForIdpAndRole(idpRoles map[string][]string) (*IDPAndRole, error)

PromptForIdpAndRole UX to prompt operator for the AWS role whose credentials will be utilized.

func (*SessionToken) RenderCredential

func (s *SessionToken) RenderCredential(ac *oaws.Credential) error

RenderCredential Renders the credentials in the prescribed format.

Jump to

Keyboard shortcuts

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