# Feature OP-8167 - Allow static mapping of OmniAuth attributes

Project: OpenProject
Status: in specification
URL: https://community.openproject.org/work_packages/OP-8167

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | Product Backlog |
| Sprint |  |
| Backlog bucket |  |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module |  |
| Feature Flag |  |
| Requires doc change | No |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

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

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

**As** an OpenProject system admin  
**I want to** be able to configure a static map changing the omniauth attribute mapping  
**so that** this configuration can be saved in the database (settings) and doesn't require a custom initiailizer or plugin.

**Acceptance criteria**

  - Allow OmniAuth strategies to provide a static attribute mapping on top of the [already supported lambda](https://github.com/opf/openproject/blob/dev/modules/auth_plugins/lib/omni_auth/flexible_strategy.rb#L57)

This should then allow for mapping attribures through the settings like this:

``` ruby
Setting.plugin_openproject_openid_connect = {
  "providers" => {
    "azure" => {
      "display_name" => "Azure",
      "identifier" => "...",
      "secret" => "...",
      "openproject_attribute_map" => {
        "login" => "UserPrincipalName",
        "mail" => "email"
      }
    }
  }
}
```
