0

On my different websites, I use Google Sign-In solution to authenticate my users.

Google sent me a mail which announced :

Google Sign-In web solution will no longer be supported after March 31, 2023. ... At your earliest convenience, migrate to the new Google Identity Services by following the migration guide.

I tried to followed what's explained in Google tutoriel, however, I'm facing this error when I use Google function "verifyIdToken($token);"

POST https://example.com/example_page.php 500 (Internal Server Error)

I am using apache2, php 8.0.5.

Thanks for help.

You will find my codes below :

Script page n°1

<html>
  <body>
    <script src="https://accounts.google.com/gsi/client" async defer></script>
    <div id="g_id_onload"
         data-client_id="https://*************************.apps.googleusercontent.com/"
         data-ux_mode="redirect"
         data-login_uri="https://www.example.com/page_n°2">
    </div>
    <div class="g_id_signin" data-type="standard"></div>
  </body>
</html>

Page n°2

require_once 'vendor/autoload.php';

$client = new Google_Client(["https://*************************.apps.googleusercontent.com/" => $CLIENT_ID]); 
$payload = $client->verifyIdToken("12345");

"12345" is used to test verifyIdToken with a wrong token, of course,

Are you already facing this problem ?

Thanks,

Alexandre

0 Answers0