Make the default scope on upstream providers config openid

This commit is contained in:
Quentin Gliech
2025-05-07 15:30:55 +02:00
parent 955bd28590
commit 4d0bce9382
2 changed files with 12 additions and 2 deletions

View File

@@ -400,6 +400,14 @@ pub struct SignInWithApple {
pub key_id: String,
}
fn default_scope() -> String {
"openid".to_owned()
}
fn is_default_scope(scope: &str) -> bool {
scope == default_scope()
}
/// Configuration for one upstream OAuth 2 provider.
#[skip_serializing_none]
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
@@ -495,6 +503,9 @@ pub struct Provider {
pub id_token_signed_response_alg: JsonWebSignatureAlg,
/// The scopes to request from the provider
///
/// Defaults to `openid`.
#[serde(default = "default_scope", skip_serializing_if = "is_default_scope")]
pub scope: String,
/// How to discover the provider's configuration

View File

@@ -1974,7 +1974,6 @@
"required": [
"client_id",
"id",
"scope",
"token_endpoint_auth_method"
],
"properties": {
@@ -2044,7 +2043,7 @@
]
},
"scope": {
"description": "The scopes to request from the provider",
"description": "The scopes to request from the provider\n\nDefaults to `openid`.",
"type": "string"
},
"discovery_mode": {