PHP - google adword api : Bad authentication,right credentials sample app

Asked By steve hunt on 19-Mar-12 12:21 AM
Earn up to 20 extra points for answering this tough question.
I am using google's own sample GetKeywords.php . Every setting in auth.ini is perfect, checked a zillion times.

--code snippet at bottom ---
{below is shown by print_r($user) ;}

}Printing user
AdWordsUser Object ( [email:AdWordsUser:private] => [myemail]@gmail.com [password:AdWordsUser:private] => [correctpassword] [requestHeaderElements:AdsUser:private] => Array ( [authToken] => [userAgent] => AwApi-PHP-3.0.0-Freelance Developer [clientEmail] => client_1+[myemail]@gmail.com [developerToken] => [myemail]@gmail.com++USD [applicationToken] => ) [defaultServer:AdsUser:private] => https://adwords-sandbox.google.com [defaultVersion:AdsUser:private] => v201109 [logsDirectory:AdsUser:private] => /var/www/api/logs [soapCompression:AdsUser:private] => 1 [soapCompressionLevel:AdsUser:private] => 1 [wsdlCache:AdsUser:private] => 0 [authServer:AdsUser:private] => https://www.google.com [oauthInfo:AdsUser:private] => [oauthHandler:AdsUser:private] => AndySmithOAuthHandler Object ( ) )

the result is :
{ this is the shown exception }
An error has occurred: Failed to get authToken. Reason: BadAuthentication


---------------this is the code,full file i send in next message, though it is google's own sample code------------------------
try {
  // Get AdWordsUser from credentials in "../auth.ini"
  // relative to the AdWordsUser.php file's directory.
  $user = new AdWordsUser();
echo "Printing user</br>";
print_r($user);
  // Log every SOAP XML request and response.
  $user->LogAll();

  // Run the example.
  GetKeywordsExample($user, $adGroupId);
} catch (Exception $e) {
  printf("An error has occurred: %s\n", $e->getMessage());
}

================
kalpana aparnathi replied to steve hunt on 19-Mar-12 03:21 PM
hi,

use this link:

https://groups.google.com/forum/#!topic/adwords-api/JwLQpzVydlU

Regards