Authentification Google

Résolu/Fermé
mobrobot Messages postés 173 Date d'inscription vendredi 13 janvier 2017 Statut Membre Dernière intervention 8 mai 2023 - 23 janv. 2022 à 21:26
mobrobot Messages postés 173 Date d'inscription vendredi 13 janvier 2017 Statut Membre Dernière intervention 8 mai 2023 - 23 janv. 2022 à 22:56
Bonjour, s'ils vous plait j'ai un problème avec l'api de google, au fait quand je clique pour me connecter avec le compte google sur le site on me dit qu'il y'a une erreur de redirection.
Erreur d'autorisation
Erreur 400 : redirect_uri_mismatch

Vous ne pouvez pas vous connecter à cette appli, car elle ne respecte pas le règlement OAuth 2.0 de Google.

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);


Merci.



Configuration: Windows / Chrome 96.0.4664.110
A voir également:

2 réponses

mobrobot Messages postés 173 Date d'inscription vendredi 13 janvier 2017 Statut Membre Dernière intervention 8 mai 2023 1
23 janv. 2022 à 22:56
Merci mon Grand sa marche.
0