okta

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package okta contains the Okta directory provider.

Index

Constants

View Source
const Name = "okta"

Name is the provider name.

Variables

View Source
var (
	ErrAPIKeyRequired           = errors.New("okta: api_key is required")
	ErrServiceAccountNotDefined = errors.New("okta: service account not defined")
	ErrProviderURLNotDefined    = errors.New("okta: provider url not defined")
)

Errors.

Functions

This section is empty.

Types

type APIError added in v0.11.0

type APIError struct {
	HTTPStatusCode int
	Body           string
	ErrorCode      string   `json:"errorCode"`
	ErrorSummary   string   `json:"errorSummary"`
	ErrorLink      string   `json:"errorLink"`
	ErrorID        string   `json:"errorId"`
	ErrorCauses    []string `json:"errorCauses"`
}

An APIError is an error from the okta API.

func (*APIError) Error added in v0.11.0

func (err *APIError) Error() string

type Option

type Option func(cfg *config)

An Option configures the Okta Provider.

func WithBatchSize

func WithBatchSize(batchSize int) Option

WithBatchSize sets the batch size option.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

WithHTTPClient sets the http client option.

func WithProviderURL

func WithProviderURL(uri *url.URL) Option

WithProviderURL sets the provider URL option.

func WithServiceAccount

func WithServiceAccount(serviceAccount *ServiceAccount) Option

WithServiceAccount sets the service account option.

type Provider

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

A Provider is an Okta user group directory provider.

func New

func New(options ...Option) *Provider

New creates a new Provider.

func (*Provider) User added in v0.11.0

func (p *Provider) User(ctx context.Context, userID, accessToken string) (*directory.User, error)

User returns the user record for the given id.

func (*Provider) UserGroups

func (p *Provider) UserGroups(ctx context.Context) ([]*directory.Group, []*directory.User, error)

UserGroups fetches the groups of which the user is a member https://developer.okta.com/docs/reference/api/users/#get-user-s-groups

type ServiceAccount

type ServiceAccount struct {
	APIKey string `json:"api_key"`
}

A ServiceAccount is used by the Okta provider to query the API.

func ParseServiceAccount

func ParseServiceAccount(rawServiceAccount string) (*ServiceAccount, error)

ParseServiceAccount parses the service account in the config options.

Jump to

Keyboard shortcuts

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