element-hq / element-hq/synapse
The OpenID Connect authenticator does not use the userinfo endpoint by default
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#9316](https://github.com/matrix-org/synapse/issues/9316).
---
I don't get any of the user information (I would have expected to see at least the display name and the email) available through the userinfo endpoint (available in the discovery endpoint) synchronized with my matrix account.
According to https://github.com/matrix-org/synapse/blob/v1.26.0/synapse/handlers/oidc_handler.py#L342 the authenticator seems to assume that the concept of userinfo endpoint is not really part of the OpenID Connect protocol and expect user related claims to be provided by the id token as soon as the scopes contains "oidc".
From what I can see in the OIDC specification the only user related information the id token is supposed to contain is the subject and if the authenticator need to resolve all the user claims (those par of profile and email) it asked the authentication endpoint to authorize it's supposed to go through the userinfo endpoint.
Synapse version: 1.26.0
My oidc config:
```
oidc_providers:
- idp_id: adm
idp_name: "My Provider"
issuer: "https://myhost/oidc/"
client_id: "matrix"
client_secret: "dontcare"
scopes: ["openid", "profile", "email"]
```
I'm testing with https://app.element.io as client.
Contributor guide
Research direction
Start by reading synapse/handlers/oidc_handler.py around the referenced v1.26.0 code and compare its handling of ID-token claims with the configured discovery information. Verify the behavior against the OpenID Connect userinfo flow; done means profile and email claims from the configured provider are synchronized with the Matrix account.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100