En complément j’ai controlé que le mdp de l’app google était ok … et il l’est … 
J’ai trouvé un projet php pour récupérer ce token … lorsque je l’exécute j’ai l’erreur : Error=BadAuthentication …qui voudrait dire que mes crédentials ne sont pas bons…mais je les ais testés … 
Quelqu’un pour qui ce la fonctionne pourrait il tester le scenario ci-dessous pour voir si il est opérationnel ou pas … 
juste remplacez vos identifiants / mdp gmail
et copier le fichier joint en modifiant l’extension par pem dans /var/www/html/gpsoauth/
pubkey.txt (207,4 Ko)
//source https://github.com/endrsmar/gpsoauthphp/blob/master/src/GPSOAuthHelper.php
$_URL = 'https://android.clients.google.com/auth';
$_AGENT = 'mgr.go/0.0.1';
$_KEY = 'AAAAgMom/1a/v0lblO2Ubrt60J2gcuXSljGFQXgcyZWveWLEwo6prwgi3iJIZdodyhKZQrNWp5nKJ3srRXcUW+F1BD3baEVGcmEgqaLZUNBjm057pKRI16kB0YppeGx5qIQ5QjKzsR8ETQbKLNWgRY0QRNVz34kMJR3P/LgHax/6rmf5AAAAAwEAAQ==';
$email='************';
$password='*****************';
masterLogin('ac2dm','us','us','en',21,$email,$password,$_URL,$_KEY,$scenario);
function masterLogin($service = 'ac2dm', $deviceCountry = 'us', $operatorCountry = 'us', $lang = 'en', $sdkVersion = 21,$email,$password,$_URL,$_KEY,$scenario){
$signature = CreateSignature($email, $password, GetPEMKey(), GetRSAKey($_KEY,$scenario),$scenario);
//$scenario->setLog('signature : ' . $signature);
//$scenario->setLog('Pem key : ' . GetPEMKey());
//$scenario->setLog('RSA key : ' . json_encode(GetRSAKey($_KEY,$scenario)));
$data = [
'accountType' => 'HOSTED_OR_GOOGLE',
'Email' => $email,
'has_permission' => '1',
'add_account' => '1',
'EncryptedPasswd' => $signature,
'service' => $service,
'source' => 'android',
'device_country' => $deviceCountry,
'operatorCountry' => $operatorCountry,
'lang' => $lang,
'sdk_version' => ''.$sdkVersion
];
return authRequest($data,$_URL,$scenario);
}
function GetPEMKey(){
return file_get_contents('/var/www/html/gpsoauth/pubkey.pem');
}
function GetRSAKey($_KEY,$scenario){
return Base64ToRSAKey($_KEY,$scenario);
}
function authRequest(array $data,$_URL,$scenario){
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL,$_URL);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curlHandle, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curlHandle, CURLOPT_POST, 1);
curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $data);
curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curlHandle, CURLOPT_HTTPHEADER, [
'User-Agent: mgrgo/0.0.1'
]);
$result = curl_exec($curlHandle);
$scenario->setLog('Resul : ' . json_encode($result));
return ParseAuthResponse($result);
}
function ByteStringToInt32($source, $offset = 0){
return (ord($source[$offset])<<24) + (ord($source[$offset+1])<<16) + (ord($source[$offset+2])<<8) + ord($source[$offset+3]);
}
function Base64ToRSAKey($key,$scenario){
//$scenario->setLog('$key : ' . $key);
$decoded = base64_decode($key);
//$scenario->setLog('decode $key : ' . $decoded);
$modLenght = ByteStringToInt32($decoded);
$expLenght = ByteStringToInt32($decoded, 4 + $modLenght);
//$scenario->setLog('$modLenght : ' . $modLenght);
//$scenario->setLog('$expLenght : ' . $expLenght);
$mod = substr($decoded, 4, $modLenght);
$exp = substr($decoded, 8 + $modLenght, $expLenght);
//$scenario->setLog('$mod : ' . $mod);
//$scenario->setLog('$exp : ' . $exp);
return ['modulus' => $mod, 'exponent' => $exp];
}
function ParseAuthResponse($response){
$result = [];
foreach (explode("\n", $response) as $line){
if (!strlen($line)) continue;
$kvp = explode('=', $line);
$result[$kvp[0]] = $kvp[1];
}
return $result;
}
function KeyToStruct(array $key,$scenario){
//$scenario->setLog('Modulus : ' . $key['modulus']);
//$scenario->setLog('exponent : ' . $key['exponent']);
return hex2bin('00000080'.bin2hex($key['modulus']).'00000003'.bin2hex($key['exponent']));
}
function CreateSignature($email, $password, $pemKey, $rsaKey,$scenario){
$encrypted = '';
openssl_public_encrypt($email.chr(0).$password, $encrypted, $pemKey, OPENSSL_PKCS1_OAEP_PADDING);
$hash = substr(sha1(KeyToStruct($rsaKey,$scenario), true), 0, 4);
return URLSafeBase64(chr(0).$hash.$encrypted);
}
function URLSafeBase64($input){
return strtr(base64_encode($input), ['+' => '-', '/' => '_']);
}