Authentification Google

Résolu
mobrobot Messages postés 182 Statut Membre -  
mobrobot Messages postés 182 Statut Membre -
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

2 réponses

  1. mobrobot Messages postés 182 Statut Membre 1
     
    Merci mon Grand sa marche.
    0