noprovider

package
v0.0.0-...-5eda4f8 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package noprovider is the generic oidc extension.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoProvider

type NoProvider struct{}

NoProvider is a generic OIDC provider.

func New

func New() NoProvider

New returns a new NoProvider.

func (NoProvider) AdditionalScopes

func (p NoProvider) AdditionalScopes() []string

AdditionalScopes returns the generic scopes required by the provider.

func (NoProvider) AuthOptions

func (p NoProvider) AuthOptions() []oauth2.AuthCodeOption

AuthOptions is a no-op when no specific provider is in use.

func (NoProvider) CheckTokenScopes

func (p NoProvider) CheckTokenScopes(token *oauth2.Token) error

CheckTokenScopes should check the token scopes, but we're not sure if there is a generic way to do this, so for now it's a no-op.

func (NoProvider) GetExtraFields

func (p NoProvider) GetExtraFields(token *oauth2.Token) map[string]interface{}

GetExtraFields returns the extra fields of the token which should be stored persistently.

func (NoProvider) GetMetadata

func (p NoProvider) GetMetadata(provider *oidc.Provider) (map[string]interface{}, error)

GetMetadata is a no-op when no specific provider is in use.

func (NoProvider) GetUserInfo

func (p NoProvider) GetUserInfo(ctx context.Context, accessToken *oauth2.Token, idToken *oidc.IDToken, providerMetadata map[string]interface{}) (info.User, error)

GetUserInfo is a no-op when no specific provider is in use.

func (NoProvider) IsTokenExpiredError

func (p NoProvider) IsTokenExpiredError(err oauth2.RetrieveError) bool

IsTokenExpiredError returns true if the reason for the error is that the refresh token is expired.

func (NoProvider) NormalizeUsername

func (p NoProvider) NormalizeUsername(username string) string

NormalizeUsername parses a username into a normalized version.

func (NoProvider) SupportedOIDCAuthModes

func (p NoProvider) SupportedOIDCAuthModes() []string

SupportedOIDCAuthModes returns the OIDC authentication modes supported by the provider.

func (NoProvider) VerifyUsername

func (p NoProvider) VerifyUsername(requestedUsername, username string) error

VerifyUsername checks if the requested username matches the authenticated user.

Jump to

Keyboard shortcuts

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