element-hq / element-hq/synapse

OIDC `picture` and `emails` attributes dropped when terms of service is enabled in Synapse

Open
#17,080 1 comment 0 reactions 0 assignees View on GitHub
A-SSO O-Uncommon S-Major T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

### Description

OIDC Emails and Pictures are dropped when terms of service is enabled in Synapse (See relevant log output) so new OIDC users do not have their emails added to their accounts automatically.

### Steps to reproduce

1. Set usermapping:

```yaml
user_mapping_provider:
config:
email_template: '{{ user.email }}'
```

3. Login as a new user, email is not added to account

### Homeserver

N/A

### Synapse Version

1.104.0

### Installation Method

Other (please mention below)

### Database

N/A

### Workers

I don't know

### Platform

EMS 16.70.1

### Configuration

user_consent:
require_at_registration: true

### Relevant log output

```shell
synapse.handlers.sso - 560 - DEBUG - GET-159- Retrieved user attributes from user mapping provider: UserAttributes(localpart='testuser1', confirm_localpart=False, display_name='Test User1', picture='https://i0.wp.com/cdn.auth0.com/avatars/tu.png?ssl=1', emails=['testuser1@example.com']) (attempt 0)

synapse.handlers.sso - 1081 - INFO - GET-164- [session nyBhoMLALAxvvBcP] Registered userid @testuser1:example.com with attributes UserAttributes(localpart='testuser1', confirm_localpart=False, display_name='Test User1, picture=None, emails=())
```

### Anything else that would be useful to know?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.