Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ldap] Add aliases for users extraFields in LDAP component #52543

Open
MarvinCrepin opened this issue Nov 10, 2023 · 0 comments
Open

[Ldap] Add aliases for users extraFields in LDAP component #52543

MarvinCrepin opened this issue Nov 10, 2023 · 0 comments
Labels

Comments

@MarvinCrepin
Copy link

MarvinCrepin commented Nov 10, 2023

Description

While currently using the Symfony LDAP component to retrieve users from my LDAP directory, I've encountered an issue. The extra_fields property of this component allows fetching additional fields in the LDAP user object.

However, in practice, when retrieving a user from LDAP, I often don't have control over the names of the fields defined in LDAP. For example, the field employeeID might be used, but I would like to be able to rename it locally to something like matricule.

Therefore, I suggest introducing a feature that allows configuring the names of these additional fields when retrieving users from LDAP.

Example

security:
  providers:
    my_ldap:
      ldap:
        service: Symfony\Component\Ldap\Ldap
        base_dn: 'dc=example,dc=com'
        search_dn: 'cn=read-only-admin,dc=example,dc=com'
        search_password: password
        default_roles: ROLE_USER
        uid_key: uid
        extra_fields:
           - matricule: employeeId

I can make a PR if this is found useful.

@carsonbot carsonbot added the Ldap label Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants