You are here

function openid_connect_update_8101 in OpenID Connect / OAuth client 8

Same name and namespace in other branches
  1. 2.x openid_connect.install \openid_connect_update_8101()

Add default config for Facebook and LinkedIn provider.

File

./openid_connect.install, line 61
Install, update and uninstall functions for the OpenID Connect module.

Code

function openid_connect_update_8101() {
  $config_factory = \Drupal::configFactory();
  $config = $config_factory
    ->getEditable('openid_connect.settings.facebook');
  $config
    ->set('enabled', FALSE);
  $config
    ->set('settings', [
    'client_id' => '',
    'client_secret' => '',
    'api_version' => '',
  ]);
  $config
    ->save(TRUE);
  $config = $config_factory
    ->getEditable('openid_connect.settings.linkedin');
  $config
    ->set('enabled', FALSE);
  $config
    ->set('settings', [
    'client_id' => '',
    'client_secret' => '',
  ]);
  $config
    ->save(TRUE);
}