You are here

public function SamlService::synchronizeUserAttributes in SAML Authentication 8.2

Same name and namespace in other branches
  1. 8.3 src/SamlService.php \Drupal\samlauth\SamlService::synchronizeUserAttributes()
  2. 4.x src/SamlService.php \Drupal\samlauth\SamlService::synchronizeUserAttributes()

Synchronizes user data with attributes in the SAML request.

Parameters

\Drupal\user\UserInterface $account: The Drupal user to synchronize attributes into.

bool $skip_save: (optional) If TRUE, skip saving the user account.

1 call to SamlService::synchronizeUserAttributes()
SamlService::acs in src/SamlService.php
Processes a SAML response (Assertion Consumer Service).

File

src/SamlService.php, line 322

Class

SamlService
Governs communication between the SAML toolkit and the IDP / login behavior.

Namespace

Drupal\samlauth

Code

public function synchronizeUserAttributes(UserInterface $account, $skip_save = FALSE) {

  // Dispatch a user_sync event.
  $event = new SamlauthUserSyncEvent($account, $this
    ->getAttributes());
  $this->eventDispatcher
    ->dispatch(SamlauthEvents::USER_SYNC, $event);
  if (!$skip_save && $event
    ->isAccountChanged()) {
    $account
      ->save();
  }
}