After upgrading to 5.0.5 and to Drupal 9.x from 8.x, I cannot retrieve the consumer id and secret programmatically.

$client_id = \Drupal::config('openid_connect.settings')->get('oauth_client_id');
$client_secret = \Drupal::config('openid_connect.settings')->get('oauth_client_secret');

I can confirm it exists in config/sync (I've replaced the actual values with *);

openid_connect.settings.yml

always_save_userinfo: true
connect_existing_users: true
override_registration_settings: true
userinfo_mappings:
  timezone: zoneinfo
  role_change: 0
  automated_opt_out: 0
  field_contract: 0
  field_department: 0
  field_device_details: 0
  field_device_id: 0
  field_first_name: 0
  field_full_name: 0
  field_last_name: 0
  field_location: 0
  phone_number: 0
  user_picture: 0
_core:
  default_config_hash: ***
oauth_client_id: ***
oauth_client_secret: ***

The config seems a bit different while using drush but the values are still missing.

drush config:get openid_connect.settings
always_save_userinfo: true
connect_existing_users: true
override_registration_settings: false
end_session_enabled: true
user_login_display: replace
redirect_login: user
redirect_logout: ''
userinfo_mappings:
  timezone: zoneinfo
role_mappings:
  administrator: {  }
  editor: {  }
  sub_editor: {  }
_core:
  default_config_hash: ***

The config hash is different in the config file vs drush. I'm guessing the module was patched previously and somewhat corrupt. What steps can I take and how can I retrieve the id and secret in code?

Comments

sadikyalcin created an issue. See original summary.

bradjones1’s picture

Project: Simple OAuth (OAuth2) & OpenID Connect » OpenID Connect / OAuth client
Version: 5.0.5 » 2.0.0-alpha12

I think you're in the wrong issue queue.