TypedJwtAuthConfig

Configures a typed JWT authentication scheme with principal type P.

Report a problem

Properties

Link copied to clipboard

Human-readable description of this authentication scheme.

Link copied to clipboard

Default handler for authentication failures.

Link copied to clipboard

JWT realm passed in the WWW-Authenticate header.

Functions

Link copied to clipboard

Configures how to retrieve an HTTP authentication header.

Link copied to clipboard
fun authSchemes(defaultScheme: String = "Bearer", vararg additionalSchemes: String)

Configures accepted authentication schemes.

Link copied to clipboard
fun validate(body: suspend ApplicationCall.(JWTCredential) -> P?)

Sets a validation function for JWTCredential.

Link copied to clipboard
fun verifier(verifier: JWTVerifier)

Sets the JWTVerifier used to verify token format and signature.

fun verifier(verifier: suspend (HttpAuthHeader) -> JWTVerifier?)

Sets a suspend function that selects the JWTVerifier for a token.

fun verifier(jwkProvider: JwkProvider, configure: JWTConfigureFunction = {})

Creates a JWTVerifier from jwkProvider.

fun verifier(issuer: String, block: JWTConfigureFunction = {})

Creates a JWTVerifier using JSON Web Keys discovered from issuer.

fun verifier(jwkProvider: JwkProvider, issuer: String, configure: JWTConfigureFunction = {})

Creates a JWTVerifier from jwkProvider and issuer.

fun verifier(issuer: String, audience: String, algorithm: Algorithm, block: Verification.() -> Unit = {})

Creates a JWTVerifier for the given issuer, audience, and algorithm.