You are here

function samlauth_update_8304 in SAML Authentication 8.3

Same name and namespace in other branches
  1. 4.x samlauth.install \samlauth_update_8304()

Change 'Folder name' config for SP cert/key into two separate file names.

File

./samlauth.install, line 80
Update and uninstall functions for the samlauth module.

Code

function samlauth_update_8304() {
  $config = \Drupal::configFactory()
    ->getEditable(SamlController::CONFIG_OBJECT_NAME);
  $cert_folder = $config
    ->get('sp_cert_folder');
  if ($cert_folder && is_string($cert_folder)) {
    $config
      ->set('sp_x509_certificate', "file:{$cert_folder}/certs/sp.crt");
    $config
      ->set('sp_private_key', "file:{$cert_folder}/certs/sp.key");
    $config
      ->clear('sp_cert_folder');
    $config
      ->save(TRUE);
  }
}