backchannel

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package backchannel implements the OIDC Back-Channel Logout plugin.

It handles POST /backchannel_logout (OIDC Back-Channel Logout §4), allowing the OP to send logout tokens to RPs via back-channel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PushLogoutTokens

func PushLogoutTokens(ctx context.Context, store storm.BackChannelStore, issuer string, signingKey storm.SigningKey, subject, sid string, logger *slog.Logger, skipTLSVerify bool) error

PushLogoutTokens sends logout tokens to all RPs that have sessions for the given subject and session ID (OIDC Back-Channel Logout §2.5).

This is the main entry point for triggering back-channel logout. Call this when a session is terminated (e.g., from endsession plugin).

func PushLogoutTokensWithClient

func PushLogoutTokensWithClient(ctx context.Context, store storm.BackChannelStore, issuer string, signingKey storm.SigningKey, subject, sid string, logger *slog.Logger, httpClient *http.Client) error

PushLogoutTokensWithClient is like PushLogoutTokens but accepts a custom HTTP client for outbound requests (e.g., with TLS skip for testing).

Types

type BackChannelLogoutClient

type BackChannelLogoutClient interface {
	storm.Client
	BackChannelLogoutURI() string
}

BackChannelLogoutClient is optionally implemented by clients that support back-channel logout. When implemented, the plugin sends logout tokens to the client's back-channel logout URI.

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin implements the OIDC Back-Channel Logout endpoint.

func New

func New(ctx *storm.PluginContext) *Plugin

New creates a new BackChannel plugin from a PluginContext.

func (*Plugin) Category

func (p *Plugin) Category() storm.PluginCategory

Category returns CategoryStandard — backchannel is optional but enabled by default.

func (*Plugin) Contribute

func (p *Plugin) Contribute(ctx context.Context, cfg *protocol.DiscoveryConfiguration)

Contribute returns the discovery fields for the backchannel logout endpoint.

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns the plugin name.

func (*Plugin) PostLogout

func (p *Plugin) PostLogout(ctx context.Context, userID, clientID, sid string)

PostLogout implements the LogoutHook interface for EndSession integration. When EndSession terminates a session, it calls this method to trigger back-channel logout to all registered RPs.

func (*Plugin) Register

func (p *Plugin) Register(r chi.Router)

Register installs the POST /backchannel_logout route.

OIDC standard endpoint: POST /backchannel_logout (OIDC Back-Channel Logout §4)

func (*Plugin) Requires

func (p *Plugin) Requires() []string

Requires returns the storage dependencies.

func (*Plugin) SetIssuer

func (p *Plugin) SetIssuer(issuer string)

SetIssuer sets the issuer URL used for logout tokens.

func (*Plugin) SetLogger

func (p *Plugin) SetLogger(logger *slog.Logger)

SetLogger sets the logger for the plugin.

Jump to

Keyboard shortcuts

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