OidcProvider

Typed authentication capabilities for one configured OpenID Connect provider.

Exposes verified protocol-native authentication schemes with precise OidcToken principal types. Map those schemes to application principals with io.ktor.server.auth.mapPrincipal.

jwtBearer is available when the provider was configured with bearer { }. introspectionBearer is available when nested bearer { introspection { } } is configured. session is available when the provider was configured with oauth { } and sessions were not disabled.

Report a problem

Properties

Link copied to clipboard

Introspection Bearer authentication scheme.

Link copied to clipboard

Configured issuer identifier URL for this provider.

Link copied to clipboard

JWT Bearer authentication scheme.

Link copied to clipboard

provider name. It is also used to derive default routes (/oidc/{name}/...), the OAuth scheme name ({name}-oauth), Bearer scheme names ({name}-jwt-bearer, {name}-introspection-bearer), and the default session cookie root ({NAME}_SESSION).

Link copied to clipboard

Typed browser session authentication scheme.

Functions

Link copied to clipboard
fun currentJwkProvider(): JwkProvider

Returns the currently active JWK provider for this provider. The returned value can change after a successful periodic discovery refresh when the discovery document points to a different JWKS URI.

Link copied to clipboard

Returns the currently active OpenID Connect discovery metadata for this provider. The returned value can change after a successful periodic discovery refresh.

Link copied to clipboard
suspend fun refreshToken(refreshToken: String): OidcTokenRefreshResult

Refreshes token material for this provider using the supplied refresh token.