Adding the optional subject key configuration in the form.

This allows the admin to choose which immutable token parameter to use as the mapping between Azure AD accounts and Drupal users.



The default "sub" is sufficient in most cases. However "oid" is useful if you want to use AD auth tokens to request access to other services and verify the user id. For example the windows graph API does not return the sub, but will return the oid in its "id" parameter. Also to sync databases between environments that use different app registrations, users will not map properly if "sub" is used.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

MorinLuc0 created an issue. See original summary.

MorinLuc0’s picture

acrazyanimal’s picture

Updated patch that uses decodeIdToken() to implement the option to use oid vs sub Id token properties for mapping the AD account to Drupal user.

acrazyanimal’s picture

Title: Allow different access token parameters to be saved » Override the 'sub' parameter in the user data tokens
Issue summary: View changes

Updated the description with more details.

acrazyanimal’s picture

webflo made their first commit to this issue’s fork.

webflo’s picture

Version: 8.x-1.x-dev » 2.0.x-dev

  • webflo committed ca28e4b on 2.0.x
    Issue #3008341 by webflo, acrazyanimal, MorinLuc0: Override the 'sub'...
webflo’s picture

Status: Needs review » Fixed

Committed to 2.x. Thanks to @acrazyanimal and @MorinLuc0

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.