Companion

Installs Oidc in this application and returns the identity-provider registry.

Use the returned Oidc to call identityProvider and keep typed route capabilities close to the issuer configuration. Registration is suspendable because it performs initial discovery, so call it from a suspend application module:

val oidc = install(Oidc) {
httpClient = openIdClient
}

val google = oidc.identityProvider("google") {
issuer = "https://accounts.google.com"
bearer {
audience = setOf("api")
}
}
val apiUser = google.jwtBearer.mapPrincipal { token -> findUser(token.claims.subject) }

Report a problem

Return

Installed OpenID Connect identity-provider registry.

Properties

Link copied to clipboard
open override val key: AttributeKey<Oidc>

Functions

Link copied to clipboard
open override fun install(pipeline: Application, configure: OidcPluginConfig.() -> Unit): Oidc