psignoret / aad-sso-wordpress

Single Sign-on with Azure Active Directory (for WordPress)
Other
270 stars 78 forks source link

Auto-Provision Usernames as Alias, Rather than Email Address #225

Open mrjarbenne opened 5 years ago

mrjarbenne commented 5 years ago

Currently users who are created via this plugin end up with a username format matching their email address. Prior to activating this plugin, our user sync through SAML created users based on their alias, so a user with the email address bob@domain.com was assigned the WP username bob. Under the new logic, Bob's username is bob@domain.com. Because we are authenticating to a BuddyPress social network, this username format makes @mentioning cumbersome.

The plugin is accounting for existing alias usernames like "bob" to be matched to Azure profiles like bob@domain.com, but new users are being created with their email address as the username. If I manually change the username from bob@domain.com to bob, the plugin still recognizes this is the same user on subsequent authentications, but it would be awesome if there was a snippet I could add, or a toggle in the settings I'm not fully understanding, to switch this logic to auto-provision users with the alias as their username.

psignoret commented 5 years ago

@mrjarbenne Thanks for this great feedback. This is definitely something we can consider for a future release.