Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

OpenID Connect integration doesn't work with Gitlab #7632

@BBBSnowball

Description

@BBBSnowball

Description

Gitlab doesn't return the username with the ID token: "Only the sub and sub_legacy claims are included in the ID token, all other claims are available from the /oauth/userinfo endpoint used by OIDC clients.", see its documentation.

Synapse can use the userinfo endpoint to query that information but it doesn't do so when the "openid" scope is used (which is required to permit access to the userinfo endpoint in Gitlab). In fact, a comment in the code already considers making this configurable. This patch does that. This makes it work for me. Is this the correct way to patch that? Should I open a PR with the patch?

Steps to reproduce

  • Configure OpenID Connect with Gitlab, i.e. Synapse is the relying party, Gitlab is the Authorization Server.
  • I have used this mapping for the username: localpart_template: "{{ user.nickname }}"
  • Try to login.
  • Login fails because localpart is empty.

Version information

I'm running 1.14.0 (on NixOS) but the relevant code is the same in the develop branch.

Metadata

Metadata

Assignees

Labels

z-bug(Deprecated Label)z-p2(Deprecated Label)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions