mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 21:42:34 +00:00
Rename userid_claim option and document OIDC options
This commit is contained in:
@@ -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)
|
||||
- deleted calendars are recoverable
|
||||
- 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
|
||||
|
||||
@@ -137,6 +137,8 @@ client_id = "rustical"
|
||||
client_secret = "secret"
|
||||
scopes = ["openid", "profile"]
|
||||
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).
|
||||
|
||||
@@ -26,7 +26,7 @@ pub struct OidcConfig {
|
||||
pub allow_sign_up: bool,
|
||||
pub require_group: Option<String>,
|
||||
#[serde(default)]
|
||||
pub userid_claim: UserIdClaim,
|
||||
pub claim_userid: UserIdClaim,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Clone)]
|
||||
|
||||
@@ -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::PreferredUsername => user_info_claims
|
||||
.preferred_username()
|
||||
|
||||
Reference in New Issue
Block a user