Rename userid_claim option and document OIDC options

This commit is contained in:
Lennart
2025-04-16 17:28:20 +02:00
parent 90606092ed
commit df3f8ea06d
3 changed files with 5 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ a CalDAV/CardDAV server
- adequately fast (I'd say blazingly fast™ :fire: if I did the benchmarks to back that claim up) - adequately fast (I'd say blazingly fast™ :fire: if I did the benchmarks to back that claim up)
- deleted calendars are recoverable - deleted calendars are recoverable
- Nextcloud login flow (In DAVx5 you can login through the Nextcloud flow and automatically generate an app token) - Nextcloud login flow (In DAVx5 you can login through the Nextcloud flow and automatically generate an app token)
- experimental OpenID Connect support (with option to disable password login) - OpenID Connect support (with option to disable password login)
## Installation ## Installation
@@ -137,6 +137,8 @@ client_id = "rustical"
client_secret = "secret" client_secret = "secret"
scopes = ["openid", "profile"] scopes = ["openid", "profile"]
allow_sign_up = false allow_sign_up = false
# claim_userid = "sub" or "preferred_username"
# require_group = "app/rustical"
``` ```
On the IdP side you have to create a client with the redirect uri `/frontend/login/oidc/callback` (subject to change). On the IdP side you have to create a client with the redirect uri `/frontend/login/oidc/callback` (subject to change).

View File

@@ -26,7 +26,7 @@ pub struct OidcConfig {
pub allow_sign_up: bool, pub allow_sign_up: bool,
pub require_group: Option<String>, pub require_group: Option<String>,
#[serde(default)] #[serde(default)]
pub userid_claim: UserIdClaim, pub claim_userid: UserIdClaim,
} }
#[derive(Deserialize, Serialize, Clone)] #[derive(Deserialize, Serialize, Clone)]

View File

@@ -197,7 +197,7 @@ pub async fn route_get_oidc_callback<AP: AuthenticationProvider>(
} }
} }
let user_id = match oidc_config.userid_claim { let user_id = match oidc_config.claim_userid {
UserIdClaim::Sub => user_info_claims.subject().to_string(), UserIdClaim::Sub => user_info_claims.subject().to_string(),
UserIdClaim::PreferredUsername => user_info_claims UserIdClaim::PreferredUsername => user_info_claims
.preferred_username() .preferred_username()