Google Authentication

Solved
mobrobot Posted messages 182 Status Membre -  
mobrobot Posted messages 182 Status Membre -
Hello, please I have a problem with the Google API. In fact, when I click to log in with my Google account on the website, it says there is a redirect error.
Authorization error
Error 400: redirect_uri_mismatch

You cannot connect to this app because it does not comply with Google's OAuth 2.0 regulations.

 session_start(); //Include Google client library include_once 'src/Google_Client.php'; include_once 'src/contrib/Google_Oauth2Service.php'; /* * Configuration and setup Google API */ $clientId = 'clientidxxxxxxxxx'; //Google client ID $clientSecret = 'clientsecretxxxxxx'; //Google client secret $redirectURL = 'http://localhost/tuto/index.php'; //Callback URL //Call Google API $gClient = new Google_Client(); $gClient->setApplicationName('Login to siteweb.com'); $gClient->setClientId($clientId); $gClient->setClientSecret($clientSecret); $gClient->setRedirectUri($redirectURL); $google_oauthV2 = new Google_Oauth2Service($gClient); 


Thank you.

Configuration: Windows / Chrome 96.0.4664.110

2 réponses

mobrobot Posted messages 182 Status Membre 1
 
Thank you, my Big one, it works.
0