AuthenticationScheme

The provider is registered lazily when the scheme is first used by authenticateWith. Reusing the same provider object, including through mapPrincipal or orAnonymous, reuses the existing application registration. Creating a different provider with the same name fails fast because provider names are application-wide identifiers.

Report a problem

Type Parameters

P

the principal type produced by this scheme.

C

the intrinsic extension context supplied to authenticated routes.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

name that identifies this authentication scheme.

Link copied to clipboard

default failure handler for routes that use the scheme. A route-level handler passed to authenticateWith overrides this value.

Functions

Link copied to clipboard
Link copied to clipboard

Clears a session for this scheme.

Link copied to clipboard
inline fun <P : Any, R : Any, C> AuthenticationScheme<P, C>.mapPrincipal(noinline transform: suspend RoutingContext.(P) -> R?): AuthenticationScheme<R, C>

Returns a scheme that produces R by transforming every successfully resolved principal of type P.

Link copied to clipboard

Returns a scheme that accepts anonymous requests when no credentials are provided.

Link copied to clipboard

Sets a session value for this scheme.