My code is as follows: ////AUTH PAGE
$clientId = "PROVIDED_HIDDEN"; $clientSecret = "PROVIDED_HIDDEN"; $access = "PROVIDED_HIDDEN"; $refresh = "PROVIDED_HIDDEN"; $callbackUrl = base_url().index_page()."google/authCallback"; // Create a new user and set the oAuth settings $user = new AdWordsUser(); $user->SetOAuth2Info(array( "client_id" => $clientId, "client_secret" => $clientSecret, "access_token" => $access, "refresh_token" => $refresh )); // Generate an authorization URL given the callback URL $authUrl = $user->GetOAuth2AuthorizationUrl($callbackUrl, true); header("Location: $authUrl"); ////////CALL BACK URL PAGE $clientId = "PROVIDED_HIDDEN"; $clientSecret = "PROVIDED_HIDDEN"; $access = "PROVIDED_HIDDEN"; $refresh = "PROVIDED_HIDDEN"; // Create a new user and set the oAuth settings $user = new AdWordsUser(); $user->SetDeveloperToken(ADWORDS_DEV_TOKEN); $user->SetClientCustomerId(ADWORDS_ACCOUNT_ID); $user->SetOAuth2Info(array( "client_id" => $clientId, "client_secret" => $clientSecret, "access_token" => $access, "refresh_token" => $refresh )); $authCode = $_REQUEST["code"]; echo "<pre>"; $token = $user->GetOAuth2AccessToken($authCode, $callbackUrl); $oauth2Info = $user->GetOAuth2Info(); print "OAuth2 authorization successful.\n"; if($user->CanRefreshOAuth2AccessToken()) /// <---- is returning true echo "CAN REFRESH"; else echo "CAN NOT REFRESH"; //// NEXT URL TO ACCESS CAMPAIGNS $tokenFilename = "./application/tmpAuth/". session_id() .".txt"; // Create a new user $user = new AdWordsUser(); // Load the oAuth settings $user->SetOAuth2Info($this->Google_model->loadAuth($tokenFilename)); //$user->RefreshOAuth2AccessToken(); //$this->Google_model->saveAuth($user, $tokenFilename); echo "<pre>"; //print_r($user); // Get a list of campaigns //$camps = $this->Google_model->GetCampaignsExample($user); $campaignService = $user->GetService('CampaignService', ADWORDS_VERSION); FAILS HERE AuthorizationError.USER_PERMISSION_DENIED On Thursday, November 14, 2013 11:38:30 AM UTC-5, Christian Gibbs wrote: > > I keep getting, AuthorizationError.USER_PERMISSION_DENIED > > What is the point of them logging in, if you need to get their permission > again. > > I want anyone to be able to access their adwords account, via our > platform. Like so many other apps and websites do. > > I have refresh tokens and I can access my own account just fine, but with > other account logins, I get this error > AuthorizationError.USER_PERMISSION_DENIED > > It make the app pointless, if I have to manually add ever client in and > then allow them to login. > > So many apps allow this kind of access. How is it possible? > > I made a google app, that has a google login authorization prompt screen, > then once the user consents, the login is successful but I can not access > their data. > > Im stuck in a circle and its driving me crazy. Please HELP! > > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://googleadsdeveloper.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.