pkce

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

func (*Handler) CanHandleTokenEndpointRequest

func (c *Handler) CanHandleTokenEndpointRequest(ctx context.Context, requester fosite.AccessRequester) bool

func (*Handler) CanSkipClientAuth

func (c *Handler) CanSkipClientAuth(ctx context.Context, requester fosite.AccessRequester) bool

func (*Handler) HandleAuthorizeEndpointRequest

func (c *Handler) HandleAuthorizeEndpointRequest(ctx context.Context, ar fosite.AuthorizeRequester, resp fosite.AuthorizeResponder) error

func (*Handler) HandleTokenEndpointRequest

func (c *Handler) HandleTokenEndpointRequest(ctx context.Context, request fosite.AccessRequester) error

func (*Handler) PopulateTokenEndpointResponse

func (c *Handler) PopulateTokenEndpointResponse(ctx context.Context, requester fosite.AccessRequester, _ fosite.AccessResponder) error

PopulateTokenEndpointResponse consumes the PKCE session. It runs after the authorization code handler invalidated the code, so a token request that fails in between cannot be retried without the verifier. The PKCE handler must therefore be composed after the authorization code handler.

type PKCERequestStorage

type PKCERequestStorage interface {
	// GetPKCERequestSession returns the PKCE request that was saved during the
	// authorize step. code is the original authorization code; signature is the
	// lookup key.
	GetPKCERequestSession(ctx context.Context, code, signature string, session fosite.Session) (fosite.Requester, error)
	CreatePKCERequestSession(ctx context.Context, signature string, requester fosite.Requester) error
	// DeletePKCERequestSession removes the PKCE row for an authorization code. code is
	// the original authorization code; signature is the lookup key. Storages that elide
	// the PKCE row entirely for some code formats (e.g., AEAD codes that inline the
	// challenge) use code to dispatch.
	DeletePKCERequestSession(ctx context.Context, code, signature string) error
}

PKCERequestStorage handles storage of PKCE requests.

The /token-side methods receive both the original authorization code and its signature. See AuthorizeCodeStorage.GetAuthorizeCodeSession for the rationale on passing both — commercial Hydra's AEAD storage decodes session state from the code itself, while the default SQL persister keys by signature.

type PKCERequestStorageProvider

type PKCERequestStorageProvider interface {
	PKCERequestStorage() PKCERequestStorage
}

Jump to

Keyboard shortcuts

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