Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-17174

Google OAuth does not work

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 3.3.10
    • None
    • Authentication
    • phpBB 3.3.10 running PHP 8.2 (same issues with PHP 8.1 though)

    Description

      When I try to use "Google" button (i.e. Login with Google OAuth) then I get the following error message:

      [phpBB Debug] PHP Warning: in file [ROOT]/vendor/lusitanian/oauth/src/OAuth/Common/Http/Client/AbstractClient.php on line 70OAuth/Common/Http/Client/AbstractClient::OAuth/Common/Http/Client/{closure}(): Argument #2 ($key) must be passed by reference, value given
      [phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 1813Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3027)

       

      AbstractClient.php:70 looks like this: 

          public function normalizeHeaders(&$headers)
          {
              // Normalize headers
              array_walk(
                  $headers,
                  function (&$val, &$key) {
                      $key = ucfirst(strtolower($key));
                      $val = ucfirst(strtolower($key)) . ': ' . $val;
                  }
              );
          }
      User Contributed Notes may suggest the likely problem here, though I have run any tests myself:

      """
      It's worth nothing that array_walk can not be used to change keys in the array.
      The function may be defined as (&$value, $key) but not (&$value, &$key).
      Even though PHP does not complain/warn, it does not modify the key.
      """

      *https://www.php.net/manual/en/function.array-walk.php*

       

      I'm can reproduce the issue with phpBB 3.3.10 (haven't tried other versions) with PHP 8.2 (also reproducible with PHP 8.1).

       

      When I click on the "Google" button get the error page given above. I am not redirected to the Google Login page (at least not visibly). 

      Notably, when I use the "Google" button with in an "Incognito Tab" then I do get the Google Login page. I have not been able to figure out the difference in state between "incognito tab" and "normal tab that previously used login/logout with a normal password".

      Attachments

        Activity

          People

            Unassigned Unassigned
            filebot filebot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: