Client settings displays config value, not database value.

Created on 23 October 2023, 8 months ago
Updated 24 October 2023, 8 months ago

Perhaps mine is a fringe case and this is as designed, but in previous versions I recall it worked as I'm looking for.

I don't want to store my client credentials in the database, so I use settings.php to add those configs. Something like...

$config['openid_connect.client.MYCLIENT']['settings']['client_id'] = $client_id;
$config['openid_connect.client.MYCLIENT']['settings']['client_secret'] = $client_secret';
$config['openid_connect.client.MYCLIENT']['settings']['domain'] = $domain;

And that works as desired.

Also, as those field values are required in the "Edit OpenID Connect" form, I just put a note for future admins... "set in settings.php".

What I've noticed though is since upgrading to ver3 (which I did just days before a version of 8.x was created for Drupal 10, so I hope I wont have to revert back to 8.x at some point), the "Edit OpenID Connect form now displays the config values set in settings and not the note I had saved.

Looking at the DB's config table, I do see my note "set in settings.php", so that's as desired.

The problem with this is that if I resave the "Edit OpenID Connect" form without replacing those field values every time, it will then store the configs in the db, which is what I'm trying to avoid.

I'm thinking it would be better for the default value of "Edit OpenID Connect" form to show the values from the database (which for 95% of the people will likely be the configs used) as opposed to the config values.

I'll try to do a patch soon. It seems just changing the default values in OpenIDConnectClientBase.php should do it.

Thoughts? Thanks!

✨ Feature request
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States kid_baco

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @kid_baco
  • πŸ‡©πŸ‡ͺGermany sanduhrs πŸ‡ͺπŸ‡Ί Heidelberg, Germany, Europe

    I think we are just using Drupal core config system here, no specialties.
    Default behavior is to not display the values from the config array, but the values from the database instead, that also might have been derived from a config import.

  • πŸ‡ΊπŸ‡ΈUnited States kid_baco

    Hello @sanduhrs
    Not sure I'm following your comment, but it sounds like we agree "Default behavior is to not display the values from the config array", which is what it seems to do... '#default_value' => $this->configuration['client_id'].
    I did a quick bandaid patch yesterday that seems to work for me for now. It doesn't display the db value as the default, but that's fine, I'm hardcoding my message and at least it doesn't display the actual credentials (which would be saved to the db the next time the "Edit OpenID Connect" was saved.
    The login process uses the correct configs (from settings.php) and everything seems to work according to plan.

Production build 0.69.0 2024