oidc

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSessionBasedOidcDelegate

func CreateSessionBasedOidcDelegate(resolveUsername func(username string) (int, error), fallbackRedirectUrl string) func(c echo.Context, idToken *oidc.IDToken, state string) error

func CreateSessionBasedOidcDelegateWithClaims added in v2.3.0

func CreateSessionBasedOidcDelegateWithClaims(resolveUsername func(username string) (int, error), fallbackRedirectUrl string, claimsFactory func() interface{}) func(c echo.Context, idToken *oidc.IDToken, state string) error

func GetFlashes added in v2.2.0

func GetFlashes(c echo.Context) ([]string, []string, error)

GetFlashes retrieves and clears flash messages for the given keys

func GetUserIdFromSession

func GetUserIdFromSession(c echo.Context) (int, error)

func IsAuthenticated

func IsAuthenticated(c echo.Context) bool

func SetFlash added in v2.2.0

func SetFlash(c echo.Context, key, message string) error

SetFlash sets a flash message with a given key (e.g., "success", "error")

Types

type OidcMiddleware

type OidcMiddleware struct {
	IdpServerUrl string
	ClientId     string
	ClientSecret string
	RedirectUrl  string
	Skipper      middleware.Skipper
	// contains filtered or unexported fields
}

func NewOidcMiddleware

func NewOidcMiddleware(idpServerUrl string, clientId string, clientSecret string, redirectUrl string, Skipper middleware.Skipper) *OidcMiddleware

func (*OidcMiddleware) CreateOidcCallbackEndpoint

func (oidcMiddleware *OidcMiddleware) CreateOidcCallbackEndpoint(delegate func(c echo.Context, idToken *oidc.IDToken, state string) error) echo.HandlerFunc

func (*OidcMiddleware) CreateOidcMiddleware

func (oidcMiddleware *OidcMiddleware) CreateOidcMiddleware(isAuthenticated func(c echo.Context) bool) echo.MiddlewareFunc

Jump to

Keyboard shortcuts

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