OidcEnvConfig
data class OidcEnvConfig(val issuer: String, val clientId: String, val clientSecret: String, val scopes: List<String>)(source)
Serializable OpenID Connect provider values commonly stored in application configuration.
The OIDC plugin does not load or merge these values automatically. Read them explicitly and apply them in Oidc.identityProvider:
ktor.oidc.google {
issuer = "https://accounts.google.com"
clientId = ${GOOGLE_CLIENT_ID}
clientSecret = ${GOOGLE_CLIENT_SECRET}
scopes = ["openid", "profile", "email"]
}Content copied to clipboard
val env = environment.config
.property("ktor.oidc.google")
.getAs<OidcEnvConfig>()
// OAuth scopes from config must include openid; the plugin does not add it automatically.
oidc.identityProvider("google") {
issuer = env.issuer
oauth {
clientId = env.clientId
clientSecret = env.clientSecret
scopes = env.scopes
}
}Content copied to clipboard