Skip to content

Commit

Permalink
Adding saml hook to attempt to view attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
protitude committed Nov 6, 2024
1 parent c8a0306 commit d3aadc9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions oit.module
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit d3aadc9

Please sign in to comment.