modulepackage
0.0.0-20250207072515-336af754612f
Repository: https://github.com/dvob/oidc-auth.git
Documentation: pkg.go.dev
# README
oidc-auth
OIDC/OAuth2 Authentication Middleware.
# Functions
AuthenticateHandler loads the session and sets it in the context.
No description provided by the author
ChainSessionSetupFunc chains multiple sessionSetupFuncs.
No description provided by the author
DebugHandler returns information about the session including the tokens.
No description provided by the author
ErrDirect creates a ServerErr which returns the actual error text to the user.
ErrMessage creates a ServerErr which uses message as response text for the user.
No description provided by the author
LoadSessionHandler loads the session and makes it available in the context for subsequent handler.
LoginHandler returns a handler which sets a state and then redirects the request to the authorization endpoint of the provider.
LogoutHandler deletes the session cookies, revokes the token (if supportd by the provider) and redirects to the end_session_uri of the provider (if supported by the provider).
NewAuthenticator validates the configuration and creates a new authenticator.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewSessionManager creates a new sessionManager which is responsible to set and get encrypted session cookies.
No description provided by the author
ProviderSelectionHandler returns a handler which shows a provider selection dialog.
No description provided by the author
RemoveSessionHandler removes the session.
RequireIDTokenGroup verifies that at least one of the given groups is available in the id_token.
SaveGroups adds groups from id_token claims to session.
No description provided by the author
SessionInfoHandler gets the session from the request using sessionManager and then renders the session info using the renderSessionInfo function.
SetCookie splits a cookie with a big value into multiple cookies with corresponding suffixes to the cookie name (e.g.
# Constants
According to https://stackoverflow.com/questions/3326210/can-http-headers-be-too-big-for-browsers chrome does not handle more than 256k of total headers.
No description provided by the author
# Variables
ErrNotSupported is returned if an action on a provider is called which is not supported.
# Structs
Authenticator combines privdes handlers and middlewares for the authentication using OIDC/OAuth2.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
LoginState gets set during the login before we redirect a request to the IDPs authorization endpoint.
PathSet contains all pathes for the session info template.
No description provided by the author
No description provided by the author
ServerErr is a error which can be passed to error handler.
Session represents a session which usually gets stored encrypted in a cookie.
SessionContext represents a Session and a reference to the Provider which issued the session.
SessionInfoTemplateData are the parameters for the session info template.
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
SessionSetupFunc is used to setup a new session.