When Clean URLs are enabled, I get PHP error:
Notice: Undefined index: QUERY_STRING in _openid_response() (line 561 of .../modules/openid/openid.inc).
when opening any "OpenID Identities" page like my.site/user/<n>/openid.
The code in question in openid.inc (version 7.8) is:
560: if (isset($_SERVER['REQUEST_METHOD'])) {
561: $data = _openid_get_params($_SERVER['QUERY_STRING']);
This happens on a shared hosting account with:
Apache/1.3.26, PHP Version 5.2.11, CGI mode
but not on my local xampp with:
Apache/2.2.17 (Win32), PHP Version 5.3.5, mod_php
Best regards,
Peter
Comments
Comment #1
c960657 commentedPatches for D7 and D8. Do they fix your problem?
The patches change the logic in _openid_response() a little to make it more in line with section 4.1.2 of the OpenID spec:
“When a message is sent as a POST, OpenID parameters MUST only be sent in, and extracted from, the POST body. ”
So it seems that the proper behaviour is to use either POST or GET variables, but not both as we do today.
Comment #3
c960657 commentedComment #4
c960657 commented#1: openid-query-string-1.patch queued for re-testing.
Comment #5
Peter Arius commentedThanks, Christian, for the patch. I tried the D7 patch on both servers and it works for me.
Comment #6
sunLooks good, but let's add a test for this.
Comment #7
wojtha commentedDifferent but related issue: #1295096: With Clean URLs enabled: Undefined index: QUERY_STRING in _openid_response() (line 561 of .../modules/openid/openid.inc)
Comment #8
c960657 commentedI finally got around to adding a test for this.
It took me a while to figure out. I was using openid_redirect() in openid_test.module to do a POST redirect back to the Relying Party, but this failed, because the embedded call to drupal_get_form('openid_redirect_form') tried to processes the current request - a POST request from the Relying Party to the OpenID Provider - and ended up doing a HTTP redirect in drupal_redirect_form(). I got around this issue by removing the form_id and form_build_id hidden fields from the form - without these, FAPI will not process the form (and as an added bonus, we avoid sending these Drupal-internal fields to OpenID Providers).
BTW this issue is sort of the counterpart of #965718: Users using Livejournal OpenID are unable to authenticate. This issue is about accepting both GET and POST in the Relying Party (i.e. Drupal) when the user is redirected from the Drupal site to the OpenID Provider, and #965718 is about using either GET or POST when the user is redirected the other way, i.e. from the Drupal site to the OpenID Provider.
Comment #9
c960657 commentedRemoving tag.
Comment #10
swentel commentedGone in D8