From d3aadc9f32fb53ca9d50f334abe183e22ba743c5 Mon Sep 17 00:00:00 2001 From: protitude Date: Wed, 6 Nov 2024 09:25:40 -0700 Subject: [PATCH] Adding saml hook to attempt to view attributes --- oit.module | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/oit.module b/oit.module index 28bf5da..2390695 100644 --- a/oit.module +++ b/oit.module @@ -748,3 +748,25 @@ function oit_block_access(Block $block, $operation, AccountInterface $account) { } } } + +/** + * Hook to alter a Drupal user account after SAML authentication. + * + * Allows other modules to change fields or properties on the Drupal account + * after a user logged in through SimpleSAMLphp. This can be used to add + * map additional SAML attributes to Drupal user profile fields. + * + * @param \Drupal\user\UserInterface $account + * The Drupal account that can be altered. + * @param array $attributes + * The SimpleSAMLphp attributes for this user. + * + * @return \Drupal\user\UserInterface|bool + * The altered Drupal account or FALSE if nothing was changed. + */ +function oit_simplesamlphp_auth_user_attributes(\Drupal\user\UserInterface $account, $attributes) { + kint($attributes); + die(); + return FALSE; +} +