Problem/Motivation
The openid_connect.client.plugin.windows_aad schema defines prompt as a string - https://git.drupalcode.org/project/openid_connect_windows_aad/-/blob/2.0...
This has not been an issue - however WindowsAad extends the base plugin OpenIDConnectClientBase - and version 3.0.0-alpha7 introduces that element into the base plugin / schema as a sequence https://git.drupalcode.org/project/openid_connect/-/blob/3.x/config/sche...
The windows_aad schema does not extend the openid_connect.client.plugin.*, but the plugin class does - as such there could be some unexpected issues with some of the code in the parent class when saving the plugin.
Notably the update hook that shipped with openid_connect breaks when used in combination with the plugin in this module. That itself is no fault of this module, but it may be easier long term to align the schemas?
Noting the while I'm pretty sure Entra ID only supports a single value (as per this modules implementation) they spec does define it as a list - https://openid.net/specs/openid-connect-core-1_0.html
Issue fork openid_connect_windows_aad-3577142
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3577142-prompt-schema-mismatch
changes, plain diff MR !46
Comments
Comment #2
ericgsmith commentedComment #3
dpiI've added my 2c in #3577049: Update.php fails with InvalidArgumentException : The configuration property settings.prompt.login doesn't exist about how OIDC project has handled it; I think they should have namespaced out their new config, and in the least checked the top contribs to make sure there are no clashes.
I'm hoping at least we can change the config name to something unique, per my MR.
This would allow for the existing AAD code to work, and I expect AAD will want to migrate its config to the new system managed by OIDC anyway, so AAD doesnt need its own
\Drupal\openid_connect_windows_aad\Plugin\OpenIDConnectClient\WindowsAad::getUrlOptions.Side commentary
Its funny that OIDC doesnt have an official base-config that its facebook/okta/generic extend, but the module still feels it can dig into any plugin and modify its settings. Perhaps OIDC should be promoting and officiating whats in
openid_connect.client.plugin.*.That way, AAD would convert from:
To
Not unlike whats in, `datetime.schema.yml` et al.
Then, it would be more appropriate for OIDC to modify
openid_connect.client.plugin.base:promptComment #4
baikho commentedOr should we switch the prompt config namespace in this module?
Comment #7
pfrillingApologies everyone... I definitely should've looked into this before making that config change as my own project relies on this one 🤦🏼.
Instead of altering the upstream, I created MR 46 in this project to alter the plugin/schema to match.
Comment #8
baikho commentedTesting the MR in #6 Seems to work fine
Comment #9
p4trizio commentedI can confirm too, the MR in #6 works fine! Thank you
Comment #10
cafuego commentedI'm not sure which module is causing my issue, after after updating openid_connect and patching openid_connect_windows_aad I end up at Hotel California; I am no longer able to logout. This issue did *not* occur with the previous version of the modules.
#3577436: Incorrect context in hook_redirect_logout_alter
The
contextvariable in the logout redirect alter hook is an array:['client' => 'windows_aad']Comment #11
p4trizio commentedI'm not able to replicate with my configuration the problem described in #10 by @cafuego
Comment #12
ericgsmith commentedI think aligning to the schema change in openid connect feels like the right way to go given these are both the same thing being implemented.
Just noting this would require a bump in the version constraints to alpha7 which is not part of the current MR.
Comment #13
ericgsmith commentedThe new handling of the
nonecompared to what the previously handled was for<noprompt>is broken.This change appears to misunderstand what none means and what Azure/Entra's no prompt default behaviour is.
From the spec - prompt=none means:
With this change when I select "No prompt (default behavior) - Let the identity service decide" it is sending this as prompt=none - which is very different to what no prompt is intended to do.
This correctly (as far as the spec is concerned) returns an error when the user is not logged into the IDP:
Unselecting all options retains the old behaviour - which is to not provide a prompt parameter to the IDP.
Additionally, I get a fatal error when adding a new plugin as the default config still has
'prompt' => '<noprompt>',Comment #14
pfrillingThanks @ericgsmith!
I updated the MR to correctly handle 'none' vs. 'noprompt' I also added an update hook to convert any original settings to the new empty array.
The upstream patch for #3577049: Update.php fails with InvalidArgumentException : The configuration property settings.prompt.login doesn't exist (MR 193) has been updated to help this patch correctly with the settings.
Comment #15
solideogloria commentedComment #16
solideogloria commentedThe fix seems to work when using no prompt, as well as when using prompt options.
+1 RTBC once the PHPCS issues are fixed
Comment #17
solideogloria commentedComment #18
ericgsmith commentedStill the final line of comment #13 to address - adding this to the MR.
With the current branch I still see
TypeError: array_values(): Argument #1 ($array) must be of type array, string given in array_values() (line 258 of modules/contrib/openid_connect/src/Plugin/OpenIDConnectClientBase.php).when creating a new client in the UI.
Comment #19
solideogloria commentedWhen visiting /admin/config/people/openid-connect/add/windows_aad, I see this error:
Warning: foreach() argument must be of type array|object, string given in Drupal\Core\Render\Element\Checkboxes::valueCallback() (line 113 of core/lib/Drupal/Core/Render/Element/Checkboxes.php).
This is because of the defaultConfiguration having
'prompt' => '<noprompt>',Comment #20
solideogloria commentedOpenIDConnectClientBase has
'#default_value' => $this->configuration['prompt'] ?? [],, so I set'prompt' => [],indefaultConfiguration()This fixes the error for me.
Comment #21
ericgsmith commentedChange looks good and resolves the error - I do wonder if this should be changed to login instead of the current default? Otherwise the default configuration triggers the "Client promp" may be misconfigured" error on the status page - would this be confusing for users who don't explicitly opt in to this behaviour?
Comment #22
solideogloria commentedI think it's fine. It's a warning, not an error. But even so, the default of none makes sense to me. If you want an SSO setup across multiple apps, selecting Force Login as the configuration breaks that, as signing into Azure AD / Entra ID elsewhere will not be enough to get a session in Drupal. The entire purpose of having Azure AD as the authentication provider for SSO is so that you can sign in to everything with a single login.
Still, if there is actually a risk for some use-cases, then maybe login is an acceptable default.
Comment #23
solideogloria commentedDoes anyone else have an opinion?
'prompt' => ['login'],is what OpenID Connect specifies as the default...Comment #24
ericgsmith commentedI agree with your assessment and it (the old noprompt behaviour) is a configuration I'd happily apply for the clients, and I think trusting the IDPs default behaviour is the ideal UX, I was just conscious that that warning appears to have been added in response to https://www.drupal.org/sa-contrib-2026-026 (which I assume we are comfortable discussion here now that is public).
Comment #25
solideogloria commentedI changed the default to err on the side of more restrictive (requiring login), as that's also the parent default config. But still, Azure AD (Entra ID) is an SSO provider. If you want it to actually be a single sign-on, instead of signing in multiple times, once for each app, then you would have to select none.
Comment #26
ericgsmith commentedSetting to RTBC on above discussion
Comment #29
webflo commentedThanks to all! I updated the contribution records.
After the update hook, I think everyone should review the updated client settings. This is because noprompt was the default in prior versions, but the update process may change it to login. Thanks to everyone for the collaboration in this issue.
Comment #31
pfrillingI just tagged the parent with 3.0.0-alpha8 which should coincide with this fix.
Note: I attempted to detect the `noprompt` settings from the windows AAD plugin within the new 30006 update hook in the parent. Definitely inspect your config.
I apologize for accidentally stepping on your configuration values. I'll definitely be more careful next time.
Comment #32
solideogloria commented@webflo Will there be a release soon?
Comment #33
webflo commentedComment #34
webflo commented@solideogloria Yes. I have tagged 2.0.0-beta10.
Comment #35
solideogloria commentedThank you