UserPrincipalName extract mail prefix

Created on 8 May 2024, 6 months ago
Updated 18 June 2024, 5 months ago

Problem/Motivation

I'm migrating from LDAP authentication to SAML with Entra ID user sync. All my previous users have sAMAccountName as ID. Now EntraID is using UPN that is in username@domain format. I would like to extract mail prefix from the UPN and use it as id for the users. In SAML I have already done this directly in portal.azure.com and it works.

Proposed resolution

For now I edited manually the UPN mapping in the src/Services/EntraSync.php file (line 215):

'userprincipalname' => $user->getUserPrincipalName(),
'userprincipalname' => is_null($user->getUserPrincipalName()) ? NULL : strstr($user->getUserPrincipalName(), '@', true),

Remaining tasks

User interface changes

It would be nice to add something in the ENTRA TO DRUPAL USER CONFIGURATION section...

API changes

Data model changes

Feature request
Status

Fixed

Version

2.1

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024