Ipseity can emit the standard OIDC email / email_verified claims, send
verification email through a pluggable mail-send channel, and verify a
principal's stored email address. External providers already key accounts on
email; these claims make that identity portable and verifiable.
email scope and claims
- A new
emailscope was added toKNOWN_SCOPES(alongsideopenid profile groups roles). Clients list it inallowed_scopes. - When a user grants
email, theid_tokenanduserinforesponse include:email— the principal's stored email (when set);email_verified—true/falsereflecting the stored verification state.
- Without the scope (or for a principal with no email) neither claim is emitted, matching the spec ("email" is only returned when the value is trustworthy; a principal that never proved it reports `email_verified: false").
Mail-send channel (pluggable)
app/mailer.py provides a Mailer interface with three backends, chosen
automatically or by IPSEITY_MAILER (smtp | console | noop):
| Backend | Selection | Behaviour |
|---|---|---|
| SMTP | IPSEITY_SMTP_HOST set, or forced |
real SMTP (STARTTLS or SSL) with optional auth |
| console | else (dev default) | prints the rendered message to stdout |
| noop | IPSEITY_MAILER=noop |
discards (tests / mail disabled) |
Configuration: IPSEITY_MAILER, IPSEITY_SMTP_HOST, IPSEITY_SMTP_PORT
(default 587), IPSEITY_SMTP_USERNAME, IPSEITY_SMTP_PASSWORD,
IPSEITY_SMTP_FROM (default ipseity@localhost), IPSEITY_SMTP_FROM_NAME
(default Ipseity), IPSEITY_SMTP_STARTTLS (default true),
IPSEITY_SMTP_SSL (default false). /healthz reports the active mailer
backend.
Verification flow
POST /api/email/verify/send(authenticated) sends a link to the principal's stored email. The authenticated principal may verify their own address; an authenticated principal targeting another principal requiresprincipals.write.- The mail contains
GET /oidc/verify-email?token=<realm>__<token>(token TTLIPSEITY_MAIL_VERIFY_TTL_SECONDS, default 3600s). The link sets the principal'semail_verified = trueand returns a confirmation page. - From then on the
email/email_verifiedclaims reporttrue.
Invalid, expired or mismatched verification links opened in a browser return to the realm's login screen with a message to sign in and request another email. See login error recovery.
Verification tokens are single-use and stored in the realm's KV. A principal
without a stored email gets 400 ("no email address to verify").
External providers
When an external provider asserts email_verified: true for the account email
(in userinfo or id_token), Ipseity records it as verified on the local
principal (auto-provision or existing account — never downgrades an already
verified address). This means an externally verified email surfaces as
email_verified: true in Ipseity's own tokens without a separate confirmation
link.
