Error Google Social Login

Post Reply
rizky
Posts: 2
Joined: 03 Jun 2023, 22:45
Name: Rizky
Location: Jakarta, Indonesia

Error Google Social Login

Post by rizky »

I got these error (as i echoing $response variableon Google Social Login module) :

Code: Select all

{ "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "status": "UNAUTHENTICATED" } } 

Actually it given blank page, no error in PHP or Javascript console,

so i tried to view whats $response output of these curl process:

Code: Select all

$ch = curl_init("https://www.googleapis.com/oauth2/v1/userinfo?access_token=" . $response['access_token']); 
Is it related to these issue?

https://developers.google.com/identity/ ... eb/sign-in

Rukovoditel version: 3.3.1
rizky
Posts: 2
Joined: 03 Jun 2023, 22:45
Name: Rizky
Location: Jakarta, Indonesia

Re: Error Google Social Login

Post by rizky »

SOLVED

I found actually somehow its about CURL_HTTP_VERSION so the response goes false

i change modules/social_login/actions/google.php:23 from

Code: Select all

    curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
into

Code: Select all

    curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
to solved these problem.

I think to detection error from curl process, it should be re-check response variable value, ie:

Image

Anyway my installation on PHP 7.4, Ubuntu 22
User avatar
support
Site Admin
Posts: 6215
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Error Google Social Login

Post by support »

Thank you for noticed about this. I have changed CURL_HTTP_VERSION_1_0 to CURL_HTTP_VERSION_2_0 for version 3.4
Post Reply