# Bug OP-17646 - OIDC attribute mapping not working for email, first name, last name

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-17646

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module | Authentication / OpenID Connect (OIDC) |
| Target versions | 16.2.1 |
| Observed in versions | 16.2.0 |
| Sprint | 16.2.1 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 16.2.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

**1: Define an OpenID Connect provider via env vars to be seeded, for instance like so:**

```bash
OPENPROJECT_OPENID__CONNECT_GOOGLE_ATTRIBUTE__MAP_LOGIN=given_name
OPENPROJECT_OPENID__CONNECT_GOOGLE_ATTRIBUTE__MAP_EMAIL=given_name
OPENPROJECT_OPENID__CONNECT_GOOGLE_ATTRIBUTE__MAP_FIRST__NAME=given_name

OPENPROJECT_OPENID__CONNECT_GOOGLE_SECRET="<secret>"
OPENPROJECT_OPENID__CONNECT_GOOGLE_IDENTIFIER="<identifier>"
OPENPROJECT_OPENID__CONNECT_GOOGLE_REDIRECT__URI="http://localhost:3000/auth/google/callback"
OPENPROJECT_OPENID__CONNECT_GOOGLE_DISPLAY__NAME="GOOGLE"
OPENPROJECT_OPENID__CONNECT_GOOGLE_ISSUER="http://localhost:3000/"
```

**2: Seed the provider via** `**bundle exec rake db:seed**`

**3: Try logging in vai the defined provider**

### What is the buggy behavior?

*   the mapping is not respected (the login works)
    

### What is the expected behavior?

*   the mapping should be respected, breaking the login
    
*   it should show the user registration form with email, first name, and last name all being the given name (e.g. Hans)
    

### Environment information

**OpenProject version**

_v16.2.0_
