Stop requesting the user email from the OIDC provider

OIDCConfig now asks for the openid and profile scopes only: kaya-oidc's
default would also request email, which the platform never stores or
exposes. The display-name fallback drops the email claim too
(preferred_username, name, then the sub).

Tests pin the configured scopes and cover an IdP that still returns an
email claim: the claim is ignored and absent from /api/me.
This commit is contained in:
woggioni committed 2026-10-14 15:56:35 +00:00
1 parent 25af0bf3fe
commit 3fe29ba740
6 files changed
+36 -11

No files matched your search

+2 -1
View File
@@ -19,9 +19,10 @@ class MeRouteTest(unittest.TestCase):
async def test_me_authenticated(self) -> None:
transport = ASGITransport(app=app)
async with AsyncClient(transport=transport, base_url="http://127.0.0.1") as client:
with oidc_user("alice"):
with oidc_user("alice", email="alice@example.com"):
response = await client.get("/api/me")
self.assertEqual(200, response.status_code)
# The email claim the IdP returns is neither stored nor exposed.
self.assertEqual({"sub": "alice", "name": "alice"}, response.json())
@async_test