Documentation
¶
Index ¶
- Variables
- func BindAuth(ctx context.Context, auth *ProviderAuth) context.Context
- func EnsureErr(err error, varErrType error) error
- type OidcProviderConfig
- type OidcProviders
- func (obj *OidcProviders) GoOidcProvider(ctx context.Context) (*gooidc.Provider, error)
- func (obj *OidcProviders) IdTokenVerifier(ctx context.Context) (*gooidc.IDTokenVerifier, error)
- func (obj *OidcProviders) Initialize(ctx context.Context) error
- func (obj *OidcProviders) Oauth2Config(ctx context.Context) (*oauth2.Config, error)
- func (obj *OidcProviders) ValidateJwt(ctx context.Context, jwt string, refreshToken string) (*ProviderAuth, error)
- type ProviderAuth
- type Providers
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInitialization = errors.New("error in initialization")
View Source
var ErrNoAuth = errors.New("no auth supplied")
View Source
var ErrNotAuthorized = errors.New("not authorized")
View Source
var ErrTokenExpired = errors.New("token is expired")
Functions ¶
Types ¶
type OidcProviderConfig ¶
type OidcProviderConfig struct {
// REQUIRED
Issuer string
// REQUIRED
ClientId string
// REQUIRED
ClientSecret string
// FULLY QUALIFIED Oauth2 Callback path
RedirectUri string
// OPTIONAL, will be defaulted if unspecified
Scopes []string
// OPTIONAL
// If set, limit the allowed signing args to this list
// defaults to RS256,RS512
SupportedSigningAlgs []string
}
type OidcProviders ¶
type OidcProviders struct {
OidcProviderConfig OidcProviderConfig
// contains filtered or unexported fields
}
func (*OidcProviders) GoOidcProvider ¶
func (*OidcProviders) IdTokenVerifier ¶
func (obj *OidcProviders) IdTokenVerifier(ctx context.Context) (*gooidc.IDTokenVerifier, error)
func (*OidcProviders) Initialize ¶
func (obj *OidcProviders) Initialize(ctx context.Context) error
func (*OidcProviders) Oauth2Config ¶
func (*OidcProviders) ValidateJwt ¶
func (obj *OidcProviders) ValidateJwt(ctx context.Context, jwt string, refreshToken string) (*ProviderAuth, error)
type ProviderAuth ¶
func GetAuth ¶
func GetAuth(ctx context.Context) *ProviderAuth
func (*ProviderAuth) GetIdToken ¶
func (p *ProviderAuth) GetIdToken() *gooidc.IDToken
func (*ProviderAuth) GetOauth2Token ¶
func (p *ProviderAuth) GetOauth2Token() *oauth2.Token
type Providers ¶
type Providers interface {
// FiberOidc uses lazy initialization - call this if you're eager!
Initialize(ctx context.Context) error
// validate an inbound auth
// N.B. this does NOT bind ProviderAuth to a context on success
ValidateJwt(ctx context.Context, jwt string, refreshToken string) (*ProviderAuth, error)
// individual provider components
GoOidcProvider(ctx context.Context) (*gooidc.Provider, error)
Oauth2Config(ctx context.Context) (*oauth2.Config, error)
IdTokenVerifier(ctx context.Context) (*gooidc.IDTokenVerifier, error)
}
Click to show internal directories.
Click to hide internal directories.