OidcOAuthConfig

OAuth/OpenID Connect configuration.

OAuth installs a provider-specific login route and callback route. The callback requires an ID token and the openid scope, then passes the verified OidcToken.Id to onAuthenticated.

Browser sessions are enabled by default. Customize them with sessions or opt out with disableSessions. Plugin-managed refresh and logout routes require sessions. When sessions are disabled, onAuthenticated is required so verified token material is not discarded.

Report a problem

Properties

Link copied to clipboard
lateinit var clientId: String

OAuth client ID. Required when OAuth is configured.

Link copied to clipboard
lateinit var clientSecret: String

OAuth client secret. Required when OAuth is configured.

Link copied to clipboard

Code challenge method used for PKCE (RFC 7636) during the authorization code flow.

Link copied to clipboard

When true, requests the OpenID Provider UserInfo endpoint after token exchange and uses that response for OidcToken.Id.userInfo.

Link copied to clipboard

Configures the OAuth login route URI.

Link copied to clipboard

Configures the OAuth callback route URI.

Link copied to clipboard

Optional resource indicators added to authorization, token, and refresh requests.

Link copied to clipboard

OAuth scopes requested during authorization.

Link copied to clipboard

Symmetric key used to encrypt the in-flight OAuth state cookie carrying state, nonce, and the PKCE code verifier between the login redirect and the callback.

Link copied to clipboard

Client authentication method for token endpoint requests: authorization code exchange and token refresh.

Functions

Link copied to clipboard

Disables browser sessions for this OAuth flow.

Link copied to clipboard
fun logout(path: String = "/oidc/", onLogout: suspend RoutingContext.() -> Unit = {})

Configures the plugin-managed logout route.

fun logout(path: String = "/oidc/", postLogoutRedirectUri: URLBuilder.() -> Unit, onLogout: suspend RoutingContext.() -> Unit = {})

Configures the plugin-managed logout route and includes post_logout_redirect_uri in RP-initiated logout.

Link copied to clipboard

Sets the handler called after a successful OAuth/OIDC login.

Link copied to clipboard

Sets the handler called when OIDC verification fails after token exchange.

Link copied to clipboard
fun refresh(path: String = "/oidc/", onRefresh: suspend RoutingContext.() -> Unit = {})

Configures the plugin-managed session refresh route.

Link copied to clipboard
fun sessions(configure: OidcSessionsConfig.() -> Unit = {})

Configures the OIDC session for this OAuth flow, including cookie transport and CSRF protection.