Display name used for username

Created on 16 August 2022, almost 2 years ago
Updated 5 September 2023, 10 months ago

Problem/Motivation

Noticed Display Name from AAD is being used as username and Drupal rejects username when it has commas (ie: Smith, Bob).

Steps to reproduce

Proposed resolution

Better use email from AAD.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs review

Version

1.4

Component

Code

Created by

πŸ‡¦πŸ‡·Argentina glajman

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡­πŸ‡ΊHungary szato

    @glajman, you can implement hook_openid_connect_userinfo_alter():

    /**
     * Implements hook_openid_connect_userinfo_alter().
     */
    function [MODULENAME]_openid_connect_userinfo_alter(array &$userinfo, array $context) {
      if ($context['plugin_id'] === 'windows_aad') {
        $userinfo['name'] = $userinfo['email'];
      }
    }
Production build 0.69.0 2024