Skip to content

Commit

Permalink
Disable openid_connect role mapping
Browse files Browse the repository at this point in the history
This feature was fixed in https://www.drupal.org/project/openid_connect/issues/3492759.
Some of our projects have lingering configuration, so the module started to eat user roles.
Helfi should not use openid_connect role mapping, since we have custom implementation.
  • Loading branch information
hyrsky committed Dec 20, 2024
1 parent 8a48962 commit 27afe21
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions helfi_tunnistamo.install
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ function helfi_tunnistamo_install() : void {
->set('user_login_display', 'below')
// Logout from openid connect provider by default.
->set('end_session_enabled', TRUE)
// Do not map roles in openid_connect module.
->set('role_mappings', [])
->save();
}

Expand Down Expand Up @@ -59,3 +61,17 @@ function helfi_tunnistamo_update_9003() : void {
->save();
}
}

/**
* UHF-X: Remove all openid_connect role mappings.
*
* Tunnistamo module has its own role mapping.
*
* @see \Drupal\helfi_tunnistamo\Plugin\OpenIDConnectClient\Tunnistamo::mapRoles()
*/
function helfi_tunnistamo_update_9004() : void {
\Drupal::configFactory()
->getEditable('openid_connect.settings')
->set('role_mappings', [])
->save();
}

0 comments on commit 27afe21

Please sign in to comment.