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"]
}
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
}
}

Report a problem

Constructors

Link copied to clipboard
constructor(issuer: String, clientId: String, clientSecret: String, scopes: List<String>)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard