glitch-soc / mastodon

A glitchy but lovable microblogging server
https://glitch-soc.github.io/docs/
GNU Affero General Public License v3.0
683 stars 181 forks source link

OIDC - Wrong field being mapped as username even though OIDC_UID_FIELD is set #2606

Open asyncmeow opened 5 months ago

asyncmeow commented 5 months ago

Steps to reproduce the problem

  1. Install a new glitch-soc instance
  2. Configure OIDC against a default Keycloak client (ie. default scopes/claims on the Keycloak side)
  3. Set OIDC_UID_FIELD=username

Expected behaviour

The username field should be mapped to the Mastodon username

Actual behaviour

The sub (subject) field was mapped to the Mastodon username, with hyphens removed (sub is a uuid)

Detailed description

When authenticating via OIDC to Mastodon, the newly-created user is created using the sub field of the userinfo, instead of the username field as is configured.

Mastodon instance

fedi.rrr.sh

Mastodon version

v4.3.0-nightly.2024-02-03+glitch

Browser name and version

Firefox 121.0.1

Operating system

macOS Ventura 13.4.1

Technical details

No response

ClearlyClaire commented 5 months ago

Can you report this upstream? There should be no difference in the way glitch-soc handles this, and I am unable to find the issue for now.