OAuth2SessionsConfig

Configures session storage and principal resolution for an OAuth2SessionFlow.

The OAuth callback authenticates the token exchange. sessionCreator maps the OAuth response to the stored session value S, and validate maps that session to the route principal P. Both are required.

Protected routes use the challenge strategy from TypedSessionAuthConfig.

Report a problem

Type Parameters

S

the session type stored by the Sessions plugin.

P

the principal type available in protected route handlers.

Properties

Link copied to clipboard

Human-readable description of this authentication scheme.

Link copied to clipboard
var name: String?

Session provider name used by the Sessions plugin.

Link copied to clipboard

Default handler for authentication failures.

Link copied to clipboard

Maps a successful OAuth response to the session value stored by the Sessions plugin.

Link copied to clipboard

Configures how the typed session scheme installs the Sessions plugin.

Functions

Link copied to clipboard
fun csrfProtection(config: CSRFConfig.() -> Unit)

Configures CSRF protection for routes authenticated with this session scheme.

Link copied to clipboard

Transforms the session value before validate resolves the route principal.

Link copied to clipboard

Sets a validation function for the session value.