Documentation
¶
Index ¶
- type AuthToken
- type DeviceAuthorization
- type IDPAndRole
- type SessionToken
- func (s *SessionToken) Authorize() (*DeviceAuthorization, error)
- func (s *SessionToken) EstablishToken() error
- func (s *SessionToken) GetAWSCredential(idpAndRole *IDPAndRole, assertion string) (*oaws.Credential, error)
- func (s *SessionToken) GetAccessToken(deviceAuth *DeviceAuthorization) (*AuthToken, error)
- func (s *SessionToken) GetIDPRolesMapFromAssertion(encoded string) (map[string][]string, error)
- func (s *SessionToken) GetSAMLAssertion(at *AuthToken) (string, error)
- func (s *SessionToken) GetSSOToken(at *AuthToken) (*AuthToken, error)
- func (s *SessionToken) PromptAuthentication(da *DeviceAuthorization)
- func (s *SessionToken) PromptForIdpAndRole(idpRoles map[string][]string) (*IDPAndRole, error)
- func (s *SessionToken) RenderCredential(ac *oaws.Credential) error
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) Authorize ¶
func (s *SessionToken) Authorize() (*DeviceAuthorization, error)
Authorize see: https://developer.okta.com/docs/reference/api/oidc/#device-authorize
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.