Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f4ed98322f | ||
|
|
bce9ad13e4 | ||
|
|
6c86dc47a2 |
@@ -4,6 +4,10 @@ One line per change, grouped by the release that shipped it. Newest
|
|||||||
first. A release is a Cargo.toml bump plus a `v<version>` tag; the
|
first. A release is a Cargo.toml bump plus a `v<version>` tag; the
|
||||||
content repos pin the tag they run (see the end of this file).
|
content repos pin the tag they run (see the end of this file).
|
||||||
|
|
||||||
|
## 0.5.8 (2026-09-30)
|
||||||
|
|
||||||
|
- Fixed: 0.5.7 asked every provider for the `phoneNumber` scope, and Kanidm denies a sign-in that asks for a scope the person does not hold, so nobody could sign in. The scope is asked for only with `OIDC_EXTRA_SCOPES=phoneNumber` (Vipps). 0.5.7 must not be deployed on a Kanidm site.
|
||||||
|
|
||||||
## 0.5.7 (2026-09-30)
|
## 0.5.7 (2026-09-30)
|
||||||
|
|
||||||
- Memberships: groups kept by portal itself (`src/memberships.rs`, `docs/memberships.md`). A membership is a case in the built-in `portal_memberships` bucket - `invited` by a desk, a `grants`, the seed or the responsible pass; `active` from the person's first sign-in, when the provider's subject, phone number or address matches; `removed` by a desk. A person is their phone number first (`+4791234567`, `PHONE_COUNTRY` for bare numbers), their address second, the provider's subject third, and one record per group and person however it was keyed. At sign-in the active memberships join the `groups` claim, so Cedar sees the same parents as before. `PEOPLE_BACKEND=memberships` switches a site; unset, a `KANIDM_API_TOKEN` means Kanidm and no token means memberships. `SEED_ADMIN_PHONE` seeds by number. The sign-in asks for the `phoneNumber` scope and reads `phone_number` from userinfo.
|
- Memberships: groups kept by portal itself (`src/memberships.rs`, `docs/memberships.md`). A membership is a case in the built-in `portal_memberships` bucket - `invited` by a desk, a `grants`, the seed or the responsible pass; `active` from the person's first sign-in, when the provider's subject, phone number or address matches; `removed` by a desk. A person is their phone number first (`+4791234567`, `PHONE_COUNTRY` for bare numbers), their address second, the provider's subject third, and one record per group and person however it was keyed. At sign-in the active memberships join the `groups` claim, so Cedar sees the same parents as before. `PEOPLE_BACKEND=memberships` switches a site; unset, a `KANIDM_API_TOKEN` means Kanidm and no token means memberships. `SEED_ADMIN_PHONE` seeds by number. The sign-in asks for the `phoneNumber` scope and reads `phone_number` from userinfo.
|
||||||
|
|||||||
Generated
+1
-1
@@ -3357,7 +3357,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "portal"
|
name = "portal"
|
||||||
version = "0.5.7"
|
version = "0.5.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "portal"
|
name = "portal"
|
||||||
version = "0.5.7"
|
version = "0.5.8"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
|
|||||||
+4
-3
@@ -76,9 +76,10 @@ memberships. With memberships:
|
|||||||
- The `groups` claim, if the provider sends one, still counts: a
|
- The `groups` claim, if the provider sends one, still counts: a
|
||||||
person's groups are the union.
|
person's groups are the union.
|
||||||
|
|
||||||
The sign-in flow asks for the `phoneNumber` scope and reads
|
With `OIDC_EXTRA_SCOPES=phoneNumber` the sign-in asks the provider for
|
||||||
`phone_number` from userinfo; a provider without either gives nothing,
|
the number and reads `phone_number` from userinfo. Set it for Vipps;
|
||||||
and matching falls back to the address.
|
not for Kanidm, which denies a sign-in that asks for a scope the
|
||||||
|
person does not hold. Without it, matching falls back to the address.
|
||||||
|
|
||||||
## Asking who belongs
|
## Asking who belongs
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ values.
|
|||||||
| `PEOPLE_BACKEND` | `kanidm` or `memberships` (see [Memberships](memberships.md)); unset, Kanidm when `KANIDM_API_TOKEN` is set, memberships otherwise |
|
| `PEOPLE_BACKEND` | `kanidm` or `memberships` (see [Memberships](memberships.md)); unset, Kanidm when `KANIDM_API_TOKEN` is set, memberships otherwise |
|
||||||
| `KANIDM_API_TOKEN` | invites and `grants:` through Kanidm |
|
| `KANIDM_API_TOKEN` | invites and `grants:` through Kanidm |
|
||||||
| `PHONE_COUNTRY` | the calling code a bare phone number gets, `+47` unless set |
|
| `PHONE_COUNTRY` | the calling code a bare phone number gets, `+47` unless set |
|
||||||
|
| `OIDC_EXTRA_SCOPES` | scopes to ask the provider for besides `openid profile email`: `phoneNumber` for Vipps. Not for Kanidm, which denies a sign-in that asks for a scope the person does not hold |
|
||||||
| `SEED_ADMIN_EMAIL` or `SEED_ADMIN_PHONE`, `SEED_ADMIN_NAME`, `SEED_GROUP` | the first person in, invited once at start into the most privileged group (or `SEED_GROUP`) |
|
| `SEED_ADMIN_EMAIL` or `SEED_ADMIN_PHONE`, `SEED_ADMIN_NAME`, `SEED_GROUP` | the first person in, invited once at start into the most privileged group (or `SEED_GROUP`) |
|
||||||
| `RESPONSIBLE_GROUP` | the group every person a page names as `responsible` joins, at start and whenever the content changes, and leaves when no page names them any more; they get an account either way |
|
| `RESPONSIBLE_GROUP` | the group every person a page names as `responsible` joins, at start and whenever the content changes, and leaves when no page names them any more; they get an account either way |
|
||||||
| `PUBLIC_URL`, `SITE_NAME` | what the site calls itself in links and mail |
|
| `PUBLIC_URL`, `SITE_NAME` | what the site calls itself in links and mail |
|
||||||
|
|||||||
+9
-6
@@ -149,7 +149,7 @@ pub async fn login(
|
|||||||
let oidc = state.oidc.configured()?;
|
let oidc = state.oidc.configured()?;
|
||||||
let (pkce_challenge, pkce_verifier) = PkceCodeChallenge::new_random_sha256();
|
let (pkce_challenge, pkce_verifier) = PkceCodeChallenge::new_random_sha256();
|
||||||
|
|
||||||
let (auth_url, csrf_state, nonce) = oidc
|
let mut request = oidc
|
||||||
.client
|
.client
|
||||||
.authorize_url(
|
.authorize_url(
|
||||||
CoreAuthenticationFlow::AuthorizationCode,
|
CoreAuthenticationFlow::AuthorizationCode,
|
||||||
@@ -159,11 +159,14 @@ pub async fn login(
|
|||||||
.add_scope(Scope::new("openid".to_string()))
|
.add_scope(Scope::new("openid".to_string()))
|
||||||
.add_scope(Scope::new("profile".to_string()))
|
.add_scope(Scope::new("profile".to_string()))
|
||||||
.add_scope(Scope::new("email".to_string()))
|
.add_scope(Scope::new("email".to_string()))
|
||||||
// A provider that verifies phone numbers (Vipps) gives one for
|
.set_pkce_challenge(pkce_challenge);
|
||||||
// this scope; Kanidm ignores a scope it does not know.
|
// What else to ask the provider for: `phoneNumber` for one that
|
||||||
.add_scope(Scope::new("phoneNumber".to_string()))
|
// verifies numbers (Vipps). Only when asked, because Kanidm denies
|
||||||
.set_pkce_challenge(pkce_challenge)
|
// a sign-in that requests a scope the person does not hold.
|
||||||
.url();
|
for scope in std::env::var("OIDC_EXTRA_SCOPES").unwrap_or_default().split_whitespace() {
|
||||||
|
request = request.add_scope(Scope::new(scope.to_string()));
|
||||||
|
}
|
||||||
|
let (auth_url, csrf_state, nonce) = request.url();
|
||||||
|
|
||||||
session
|
session
|
||||||
.insert(PKCE_KEY, pkce_verifier.secret())
|
.insert(PKCE_KEY, pkce_verifier.secret())
|
||||||
|
|||||||
Reference in New Issue
Block a user