document-archive: an operator granted before their first sign-in lands as a SECOND, member-role account — the pre-provisioned superuser has no email for allauth to match #1604

Closed
opened 2026-09-18 20:52:42 +00:00 by ben · 1 comment
Owner

What happened

Run 16 of the #1547 roles proof (20260918T200406Z, 40/45) — operator-document-archive red:

the granted operator did not reach the admin surface /admin/ … "You are authenticated as proof-operator3, but are not authorized to access this page."

Paperless' user table on the kept box:

4|proof-operator||t|t            <- pre-provisioned by the reconciler (#1553): superuser, NO email, no social account
6|proof-operator3|proof-operator@idss-proof.nz|f|f   <- made by the operator's first OIDC sign-in

Cause

documentarchivesvc.provisionOperator creates a username-only account on the reasoning that the auto-signup "links by the preferred_username claim". Paperless signs people in through django-allauth, which knows a returning person by their social account and, for a person who has none yet, by their verified email — and only when the provider app's email_authentication is on. A username matches nothing, so allauth signs the operator up as a NEW user and de-duplicates the name to proof-operator3. The pre-provisioned superuser is never reached. kanidm's email does arrive verified (account_emailaddress.verified = t on the box).

Fix

  • the render sets email_authentication: true on the allauth provider app (kanidm is the community's only, own IdP; one address names one person, ADR 0251);
  • the port takes the person → email resolver the Grist and Listmonk ports already take, pre-provisions WITH the email (no email on record → ErrNoEmailOnRecord, the role reads owed), and records the address on an existing email-less account;
  • refused writes carry Paperless' own reason.

Being landed by the #1547 babysitting session.

## What happened Run 16 of the #1547 roles proof (`20260918T200406Z`, 40/45) — `operator-document-archive` red: > the granted operator did not reach the admin surface /admin/ … "You are authenticated as **proof-operator3**, but are not authorized to access this page." Paperless' user table on the kept box: ``` 4|proof-operator||t|t <- pre-provisioned by the reconciler (#1553): superuser, NO email, no social account 6|proof-operator3|proof-operator@idss-proof.nz|f|f <- made by the operator's first OIDC sign-in ``` ## Cause `documentarchivesvc.provisionOperator` creates a username-only account on the reasoning that the auto-signup "links by the preferred_username claim". Paperless signs people in through **django-allauth**, which knows a returning person by their social account and, for a person who has none yet, by their **verified email** — and only when the provider app's `email_authentication` is on. A username matches nothing, so allauth signs the operator up as a NEW user and de-duplicates the name to `proof-operator3`. The pre-provisioned superuser is never reached. kanidm's email does arrive verified (`account_emailaddress.verified = t` on the box). ## Fix - the render sets `email_authentication: true` on the allauth provider app (kanidm is the community's only, own IdP; one address names one person, ADR 0251); - the port takes the person → email resolver the Grist and Listmonk ports already take, pre-provisions WITH the email (no email on record → `ErrNoEmailOnRecord`, the role reads owed), and records the address on an existing email-less account; - refused writes carry Paperless' own reason. Being landed by the #1547 babysitting session.
Author
Owner

Landed on main as d3e545c9: the render sets email_authentication, the port pre-provisions WITH the person's email (none on record reads owed), records it on an email-less account, and refused writes carry Paperless' own reason. The double now matches a sign-in the way allauth does. Live proof is the next #1547 fire's operator-document-archive. Closing.

Landed on main as `d3e545c9`: the render sets `email_authentication`, the port pre-provisions WITH the person's email (none on record reads owed), records it on an email-less account, and refused writes carry Paperless' own reason. The double now matches a sign-in the way allauth does. Live proof is the next #1547 fire's `operator-document-archive`. Closing.
ben closed this issue 2026-09-18 20:57:11 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1604
No description provided.