opf/openproject-auth_plugins — pull request #2 by oliverguenther (2014-10-17 12:16:42+00:00)
Title: Feature/omniauth attribute mapping

OpenProject currently employs a fixed attribute mapping schema for
userdata extracted from OmniAuth::AuthHash.

This feature adds an override to user attributes optionally defined within
each strategy plugin.
It requires a tiny counterpart change in OpenProject's `Concerns::OmniAuth` to call the strategy override, if it exists. See the accompanying pull request at [https://github.com/opf/openproject/pull/2062](https://github.com/opf/openproject/pull/2062)

Motivation for implementation choices:

1. **The attribute mapping is included in the strategy options**. This reduces changes to the FlexibleStrategy to a minimum and at the same time, allows different mappings for each provider, even if the underlying strategy is identical.
2. **The attribute mapping is a block, called with the OmniAuth userdata** `OmniAuth::AuthHash`. This allows users to access raw attributes returned from the authentication scheme (in my use-case: LDAP). This would be cumbersome with only a simple hash mapping. However, it would be conceivable to allow blocks and hashes for simpler uses.

- [The corresponding Pull Request at opf/openproject](https://github.com/opf/openproject/pull/2062)
- [The respective discussion in the boards can be found here](https://community.openproject.org/topics/3107)
- [The corresponding work package](https://community.openproject.org/work_packages/16841)