Config

class Config : AuthenticationProvider.Config

A configuration for the jwt authentication provider.

Functions

Link copied to clipboard
fun authHeader(block: (ApplicationCall) -> HttpAuthHeader?)

Retrieves an HTTP authentication header. By default, it parses the Authorization header content.

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

Specifies what to send back if JWT authentication fails.

Link copied to clipboard
fun skipWhen(predicate: (ApplicationCall) -> Boolean)
Link copied to clipboard
fun validate(validate: suspend ApplicationCall.(JWTCredential) -> Principal?)

Allows you to perform additional validations on the JWT payload.

Link copied to clipboard
fun verifier(verifier: JWTVerifier)
fun verifier(verifier: (HttpAuthHeader) -> JWTVerifier?)
fun verifier(jwkProvider: JwkProvider, configure: JWTConfigureFunction = {})
fun verifier(issuer: String, block: JWTConfigureFunction = {})
fun verifier(jwkProvider: JwkProvider, issuer: String, configure: JWTConfigureFunction = {})
fun verifier(issuer: String, audience: String, algorithm: Algorithm, block: Verification.() -> Unit = {})

Provides a JWTVerifier used to verify a token format and signature.

Properties

Link copied to clipboard
val name: String?
Link copied to clipboard
var realm: String

Specifies a JWT realm to be passed in WWW-Authenticate header.