oidcmiddleware

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthMiddleware added in v0.4.0

func NewAuthMiddleware(ctx context.Context, e *echo.Echo, store sessions.Store, opts *Options) (echo.MiddlewareFunc, error)

NewAuthMiddleware returns an echo middleware that can be used to protect routes with OpenID Connect.

Types

type Options

type Options struct {
	// IssuerURL is the URL of the OpenID Connect issuer.
	IssuerURL string
	// RedirectURL is the URL to redirect the user to after they've logged in.
	RedirectURL string
	// ClientID is the OAuth2 client ID.
	ClientID string
	// ClientSecret is the OAuth2 client secret.
	ClientSecret string
	// MaxAge is how long the users session should be valid for.
	MaxAge *time.Duration
	// TLSClientConfig is the TLS configuration to use when connecting to the issuer.
	TLSClientConfig *tls.Config
	// DiscoverIssuer is whether to discover the issuer public URL using the OpenID Connect discovery endpoint.
	// This is required if connecting to the issuer on a private URL.
	DiscoverIssuer bool
}

Options allows configuring the OpenID Connect middleware.

Jump to

Keyboard shortcuts

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