okta

package
v0.0.0-...-c407d37 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const AdminProviderName = "adminProvider"
View Source
const MilProviderName = "milProvider"
View Source
const OfficeProviderName = "officeProvider"

Variables

This section is empty.

Functions

func GenerateNonce

func GenerateNonce() string

func VerifyProvider

func VerifyProvider(name string) error

Check if the provided provider name exists

Types

type Data

type Data struct {
	RedirectURL string
	Nonce       string
	GothSession goth.Session
}

type Provider

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

This provider struct will be unique to mil, office, and admin. When you run goth.getProvider() you'll now have the orgURL, clientID, and secret on hand

func ConvertGothProviderToOktaProvider

func ConvertGothProviderToOktaProvider(gothProvider goth.Provider) (*Provider, error)

func GetOktaProviderForRequest

func GetOktaProviderForRequest(r *http.Request) (*Provider, error)

This function will select the correct provider to use based on its set name.

func NewOktaProvider

func NewOktaProvider(logger *zap.Logger) *Provider

func NewProvider

func NewProvider(orgURL string, callbackURL string, clientID string, secret string) *Provider

NewProvider creates a new instance of the Okta provider with the specified orgURL

func WrapOktaProvider

func WrapOktaProvider(provider *gothOkta.Provider, orgURL string, clientID string, secret string, callbackURL string, logger *zap.Logger) *Provider

This function allows us to wrap new registered providers with the zap logger. The initial Okta provider is already wrapped This will wrap the gothOkta provider with our own version of OktaProvider (With added methods)

func (*Provider) AuthorizationURL

func (op *Provider) AuthorizationURL(r *http.Request) (*Data, error)

This function will use the OktaProvider to return the correct authorization URL to use

func (*Provider) GetAuthURL

func (op *Provider) GetAuthURL() string

func (*Provider) GetCallbackURL

func (op *Provider) GetCallbackURL() string

func (*Provider) GetClientID

func (op *Provider) GetClientID() string

func (*Provider) GetCreateAccountURL

func (op *Provider) GetCreateAccountURL(activate string) string

func (*Provider) GetCreateUserURL

func (op *Provider) GetCreateUserURL(activate string) string

func (*Provider) GetIssuerURL

func (op *Provider) GetIssuerURL() string

func (*Provider) GetJWKSURL

func (op *Provider) GetJWKSURL() string

func (*Provider) GetLogoutURL

func (op *Provider) GetLogoutURL() string

func (*Provider) GetOpenIDConfigURL

func (op *Provider) GetOpenIDConfigURL() string

func (*Provider) GetOrgURL

func (op *Provider) GetOrgURL() string

func (*Provider) GetRevokeURL

func (op *Provider) GetRevokeURL() string

func (*Provider) GetSecret

func (op *Provider) GetSecret() string

func (*Provider) GetSessionsURL

func (op *Provider) GetSessionsURL() string

func (*Provider) GetTokenURL

func (op *Provider) GetTokenURL() string

func (*Provider) GetUserInfoURL

func (op *Provider) GetUserInfoURL() string

func (*Provider) GetUserURL

func (op *Provider) GetUserURL(oktaUserID string) string

func (*Provider) RegisterOktaProvider

func (op *Provider) RegisterOktaProvider(name string, orgURL string, callbackURL string, clientID string, secret string, scope []string) error

Create a new Okta provider and register it under the Goth providers

func (*Provider) RegisterProviders

func (op *Provider) RegisterProviders(v *viper.Viper) error

Function to register all three providers at once.

func (*Provider) SetCallbackURL

func (op *Provider) SetCallbackURL(URL string)

func (*Provider) SetClientID

func (op *Provider) SetClientID(ID string)

func (*Provider) SetOrgURL

func (op *Provider) SetOrgURL(orgURL string)

func (*Provider) SetSecret

func (op *Provider) SetSecret(secret string)

func (Provider) TokenURL

func (op Provider) TokenURL(r *http.Request) string

TokenURL returns a full URL to retrieve a user token from okta.mil

Jump to

Keyboard shortcuts

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