diff --git a/conduwuit-example.toml b/conduwuit-example.toml index e860a971c..509cac4af 100644 --- a/conduwuit-example.toml +++ b/conduwuit-example.toml @@ -2582,10 +2582,12 @@ # Additional scopes Continuwuity should request from the IDP. This may be # necessary to access certain claims. Continuwuity always requests the -# `openid` scope. +# `openid` scope, regardless of the contents of this option, +# and will also request the `profile` scope by default if this option is +# not set. # # env: CONTINUWUITY_OAUTH__OIDC__ADDITIONAL_SCOPES -#additional_scopes = [] +#additional_scopes = ["profile"] # Additional trusted audiences that Continuwuity will accept in the `aud` # claim of the OIDC token returned by the IDP. If your identity diff --git a/src/core/config/mod.rs b/src/core/config/mod.rs index 56b0db526..5059a28d1 100644 --- a/src/core/config/mod.rs +++ b/src/core/config/mod.rs @@ -2823,10 +2823,12 @@ pub struct OidcConfig { /// Additional scopes Continuwuity should request from the IDP. This may be /// necessary to access certain claims. Continuwuity always requests the - /// `openid` scope. + /// `openid` scope, regardless of the contents of this option, + /// and will also request the `profile` scope by default if this option is + /// not set. /// - /// default: [] - #[serde(default)] + /// default: ["profile"] + #[serde(default = "default_additional_scopes")] pub additional_scopes: Vec, /// Additional trusted audiences that Continuwuity will accept in the `aud` @@ -3446,6 +3448,8 @@ fn default_unauthenticated_request_ratelimit() -> PerMinut PerMinuteRatelimiter::new(Quota::per_minute(30.try_into().unwrap())) } +fn default_additional_scopes() -> Vec { vec![Scope::new("profile".to_owned())] } + // NOTE: This must be declared *after* every config struct in this file. The // example config generator writes sections in macro expansion order, and the // `global` section truncates the file, so declaring this module any earlier