Some identity providers provide tokens using POST parameters rather than url encoded GET parameters.

This is the recommended mode if using Azure's OpenID Connect.

The attached patch changes OpenIDConnectRedirectController.php to support both POST and GET.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drasgardian created an issue. See original summary.

drasgardian’s picture

patch attached.

Mario Steinitz’s picture

Status: Active » Needs review

Thank you for your patch. I had a quick review and don't see a reason, why incoming POST responses should not be supported.

As your patch does not include any breaking changes,
+1 for RTBC.

eiriksm’s picture

Status: Needs review » Reviewed & tested by the community

There is one coding standard error in the patch: There should be no blank line after an inline comment.

     // ensure that the user, not a malicious script, is making the request.
-    $query = $this->requestStack->getCurrentRequest()->query;
-    $state_token = $query->get('state');
+
+    $request = $this->requestStack->getCurrentRequest();
+    $state_token = $request->get('state');

Other than that, looks great!

finne’s picture

I can confirm this works fine in our project.

b2f’s picture

Also confirmed to work here with hybrid authentication flow and user infos stored in the id_token (from https://www.drupal.org/project/openid_connect/issues/2965594)

slasher13’s picture

jcnventura’s picture

Status: Reviewed & tested by the community » Needs review

Without an interdiff, this loses RTBC.

slasher13’s picture

Status: Needs review » Reviewed & tested by the community

It's a clean re-roll without changes.

  • slasher13 authored bd4d9f2 on 8.x-1.x
    Issue #2984506 by drasgardian, slasher13, eiriksm, Mario Steinitz, finne...
jcnventura’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.