oauth_oidc

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OIDCConnection

type OIDCConnection struct {
	oauth.BaseOAuthProvider
	ProviderName string

	Provider *oidc.Provider
	Config   oauth2.Config
	Verifier *oidc.IDTokenVerifier

	LogoBytes      []byte
	DynamicBaseURL func(r *http.Request) string
}

OIDCConnection implements a generic OIDC provider.

func NewOIDCConnection

func NewOIDCConnection(ctx context.Context, params OIDCConnectionParams) (*OIDCConnection, error)

NewOIDCConnection creates a new OIDCConnection instance. providerName should be unique (e.g., "google", "azure", etc.) for each connection.

func (*OIDCConnection) GetName

func (o *OIDCConnection) GetName() string

GetName returns the configured provider name.

func (*OIDCConnection) GetUserByEmail

func (o *OIDCConnection) GetUserByEmail(email string, r *http.Request, customUserInterface ...users.LocksmithUserInterface) users.LocksmithUserInterface

GetUserByEmail retrieves the user given an email.

func (*OIDCConnection) RegisterRoutes

func (o *OIDCConnection) RegisterRoutes(apiMux *http.ServeMux)

RegisterRoutes registers the OIDC endpoints.

type OIDCConnectionParams

type OIDCConnectionParams struct {
	Issuer                 string
	ClientID               string
	ClientSecret           string
	BaseURL                string
	ProviderName           string
	DB                     database.DatabaseAccessor
	LogoBytes              []byte
	CustomizedGetUserQuery func(email string, r *http.Request) map[string]interface{}
	DynamicBaseURL         func(r *http.Request) string
}

Jump to

Keyboard shortcuts

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