Documentation ¶
Index ¶
- type Authenticator
- func (a *Authenticator) Authenticate(ctx context.Context, creds core.Credentials) (core.User, core.AuthenticationProviderError)
- func (a *Authenticator) GenerateSAMLAssertion(ctx context.Context, creds core.Credentials, appID string) (*core.SAMLResponse, core.AuthenticationProviderError)
- func (a *Authenticator) ListApplications(ctx context.Context, user core.User) ([]core.Application, core.AuthenticationProviderError)
- type OktaError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
func New ¶
func New(host, token string, mfa duo.Duo) (*Authenticator, error)
New creates a new Okta authenticator. An error may be returned if the token or host are in the incorrect format - please refer to the Okta documentation at github.com/okta/okta-sdk-golang/
func (*Authenticator) Authenticate ¶
func (a *Authenticator) Authenticate(ctx context.Context, creds core.Credentials) (core.User, core.AuthenticationProviderError)
Authenticate retrieves a list of applications for user with the given username and password.
This will first attempt to validate if the user has the appropriate credentials before returning applications for that user.
func (*Authenticator) GenerateSAMLAssertion ¶
func (a *Authenticator) GenerateSAMLAssertion(ctx context.Context, creds core.Credentials, appID string) (*core.SAMLResponse, core.AuthenticationProviderError)
GenerateSAMLAssertion should generate a SAML assertion that the user may exchange with the target application in order to gain access to it. This will initiate a multi-factor request with Duo.
func (*Authenticator) ListApplications ¶
func (a *Authenticator) ListApplications(ctx context.Context, user core.User) ([]core.Application, core.AuthenticationProviderError)
ListApplications should list all the applications the given user is entitled to access.
type OktaError ¶
type OktaError error
OktaError is an error from Okta.
var ( ErrOktaBadRequest OktaError = errors.New("bad request") ErrOktaForbidden OktaError = errors.New("forbidden") ErrOktaCouldNotCreateSession OktaError = errors.New("could not create a session") ErrOktaSAMLError OktaError = errors.New("could not get a SAML response") ErrOktaInternalServerError OktaError = errors.New("internal server error") ErrOktaUnspecified OktaError = errors.New("unspecified") )
A list of standard errors that can be returned by by Okta client.