Closed (fixed)
Project:
OpenID Connect / OAuth client
Version:
3.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Mar 2026 at 15:54 UTC
Updated:
3 Apr 2026 at 18:50 UTC
Jump to comment: Most recent
Comments
Comment #2
mably commentedComment #3
mably commentedThe root cause is a mismatch between the stored data and the config schema for the
promptsetting.The schema correctly defines
promptas asequence(indexed array of strings), but the actual stored value is an associative array with string keys —['login' => 'login']— because#type => checkboxesproduces that format andsubmitConfigurationForm()never normalizes it.defaultConfiguration()also hardcodes the associative format.When Drupal 11's strict config validation encounters the string key
login, it tries to resolve the property pathsettings.prompt.loginagainst the schema — which only defines numeric sequence items (settings.prompt.0,settings.prompt.1, etc.). This causes theInvalidArgumentException.An additional complication: contrib plugins like
openid_connect_windows_aadstorepromptas a plain string (e.g.<noprompt>) with their own radios form element and read it back as a string ingetUrlOptions(). The base class must handle both formats gracefully.The fix normalizes the data to match the schema, with guards for contrib string values:
1.
OpenIDConnectClientBase.phpdefaultConfiguration(): return['login']instead of['login' => 'login']submitConfigurationForm(): normalize checkboxes output to an indexed array witharray_values(array_filter(...))#default_value: add an(array)cast so contrib string values don't crashbuildConfigurationForm()getUrlOptions(): remove the now-unnecessaryarray_filter()wrapper since stored data is already clean2.
openid_connect.installopenid_connect_update_30005(): set['login'](indexed) instead of['login' => 'login'](associative), and only for clients that don't already have apromptvalue — contrib plugins that storepromptas a string are left untouchedopenid_connect_requirements(): add anis_array()guard beforearray_filter()so contrib string values don't crash the status pageComment #5
mably commentedComment #6
ericgsmith commentedCode changes look good and explanation in #3 is clear and correct.
Initially I thought there might be a bug - but then when I was checking the note around
openid_connect_windows_aadif found that while that module defines prompt as a string, it didn't ship with an update hook to set the default value - so I had the schema in place for that plugin but not an existing value. So with this patch applied I got:Saving my openid_connect_windows_aad client settings prior to update db allow the update to run as expected.
I don't specifically think that openid_connect needs to cater for that scenario - but its an interesting problem of the base class introducing something that is already defined by other plugins.
Comment #7
richard.thomas commentedWe updated to 8.x-1.5 and noticed this also might be broken out of the box after the update hook runs? It looks like the numeric value from the config entity and the keyed value from defaultConfiguration() combine so we end up with ?prompt=login%20login in the redirected URL which breaks (at least on Entra ID).
Comment #9
richard.thomas commentedPushed up a 1.x version of the changes in a separate MR https://git.drupalcode.org/project/openid_connect/-/merge_requests/185.
One issue is the merging of the default plugin configuration 'prompt' setting with what's in the config. By default this was merging the arrays together (if we're going to use a numeric array), meaning there wasn't a way to disable the default login option or have no prompt options selected at all. I've updated this MR to just overwrite the entire prompt array if it's set in the configuration.
Comment #10
dpiSo yes, OIDC module is colliding with openid_connect_windows_aad.
But, OIDC should be namespacing out all third party config into its own sub mapping of the config, but if that isnt possible (requires rearchitecture), then doing its best to not re-use the keys used by plugins is ideal.
Unfortunately AAD uses a string, which is incompatible with the newly introduced prompt key in OIDC. Preferably, OIDC would rename its key. Its going to be a mess if OIDC's migration is broken. AAD also doesnt even have an opportunity to jump in and sort itself out before OIDC's migration runs.
Further, we shouldnt be booting the plugin with
->getPlugin()in a migration, and especially without handling failures. We have no idea if the plugin exists or is not broken. It should be entirely possible to migrate configuration by only dealing with the only the configFactory service.Going to push an alternative to above MR.
Comment #12
dpiPushed another new MR.
I should also mention that sure, we could "guess" and cast any existing "prompt" values to an array, but we have no idea how people are actually using it downstream. Sure, it would work for AAD, because we can see and interrogate the code. But people overriding AAD, or people putting together their own plugins, could be doing all kinds of custom things.
It sounds like some of the array-merging aspects may also be applicable.
If this MR is under consideration for rejection for renaming key aspect, please consider: how will downstream handle a migration of their potentially broken/data-loss config. And, in the least, the update strategy should be converted to config factory. Manipulating config entities in .install isnt permitted.
Comment #16
cafuego commentedGiven v3 is still in alpha, this seems like a good time to make that change. It's too late for 1.x.
I think it's completely fine for openid_connect to use arbitrary settings keys, and as long as they're documented any plugins can work around them or at least not try to re-implement them on their own :-)
And I guess that #3577142: prompt schema mismatch with parent plugin did just that, so I'll shut up now 😂
Comment #19
pfrillingApologies everyone for the botched update hook and thanks for all the feedback. I truly appreciate it.
I decided to merge the changes from MR 184 and MR 186 into the new MR 193. I tested that patch along with the patch in #3577142: prompt schema mismatch with parent plugin for openid_connect_windows_aad. With those two patches applied, the new update hook 30006 runs as expected in my project.
I think it makes the most sense to keep the `prompt` option with this upstream project as it is part of the spec and it should have been a setting in this module for some time now.
Please review and let me know if you have any feedback.
Comment #20
richarddavies commentedI followed your instructions and used both patches (the new MR 193 and MR 46 from #3577142). I can now confirm that all of the update hooks were successful this time and I'm no longer getting an error on the status page.
Comment #21
solideogloria commentedThe changes in MR !193 fix the issue.
Comment #22
dpiWhen the alpha has more 3x usage (22k sites) than the one it replaces, a significant portion of Drupal users, I think it loses any "alpha" safety net. It's defacto supported.
As much as I'd hate to be in that situation myself, its brought on by v3 being the only d11 compatible version.
Comment #23
solideogloria commentedAgreed. It's the primary branch that is used -- by almost 75% of OpenID Connect users (~22,000 sites).
Comment #24
ttnt commentedGood day,
Will a new release be made or should we run these 2 patches to keep functionality on the latest version?
Is it perhaps safer to stay on the previous alpha until a release is made?
It is unclear to me how best to proceed right now (regarding risk of breaking things).
Thanks
Comment #25
solideogloria commentedI'm running with the two patches, because the latest release includes security fixes.
Still, it would be awesome if this could be merged and released!
Comment #29
solideogloria commentedComment #31
ttnt commentedThanks for the release, I could update from alpha6 to alpha8 without issues.
All seems (?) to be working as expected.
No additional patches were needed for my setup.
Comment #32
gravisrs commentedMy case might also be connected.
If I leave "prompt" settings empty my query contains: ...&prompt=0%200%200%200&....
which are imploded 4 element nulls array - "0 0 0 0"
Comment #33
steinmb commented@gravisrs: Thank for the feedback, go ahead and open a separate issue as this is now closed.