haive / google-api-adwords-php

Automatically exported from code.google.com/p/google-api-adwords-php
Apache License 2.0
0 stars 0 forks source link

Oauth2.0 approval_prompt = force #102

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello All,

I am not seeing approval_prompt option under Oauth2.0 authentication which can 
enable user to approve appllication request every time he logged in with google 
account.

For more info please see this forum question:
https://groups.google.com/forum/#!searchin/adwords-api/oauth2.0/adwords-api/GTCl
xukrLCE/GdO1bRsGkWkJ

No option for this under PHP Client library v201306.

Thanks,
Chirag

Original issue reported on code.google.com by chirag.e...@gmail.com on 15 Jul 2013 at 8:51

GoogleCodeExporter commented 8 years ago
Hi,

Any update?

Original comment by chirag.e...@gmail.com on 18 Jul 2013 at 6:32

GoogleCodeExporter commented 8 years ago
Hi Chirag,

Thank you for your feature request. For the a quick workaround, I suggest you 
edit your copy of the OAuth2Handler.php to add the following:

Edit the GetAuthorizationUrl.php function to update the $params array as 
follows:

    $params = array_merge($params, array(
        'response_type' => 'code',
        'client_id' => $credentials['client_id'],
        'redirect_uri' => $redirectUri,
        'scope' => $this->scope,
        'access_type' => $offline ? 'offline' : 'online',
        'approval_prompt' => 'force',
    ));

File path: 
<root>/src/Google/Api/Ads/Common/OAuth2Handler.php

See the link below for the current version:

https://code.google.com/p/google-api-adwords-php/source/browse/src/Google/Api/Ad
s/Common/Util/OAuth2Handler.php#59

Regards,

- Paul, AdWords API Team.

Original comment by api.pmat...@gmail.com on 22 Jul 2013 at 2:36

GoogleCodeExporter commented 8 years ago

Original comment by api.pmat...@gmail.com on 22 Jul 2013 at 2:36

GoogleCodeExporter commented 8 years ago
Hello Paul,

Yes, I dont wants to disturb API. So i have done this when getting to 
authorization Url by adding extra param.

        $offline = TRUE;
    $extra_para = array('approval_prompt' => 'force');
    $OAuth2Handler = $user->GetOAuth2Handler();
    $authorizationUrl = $OAuth2Handler->GetAuthorizationUrl($user->GetOAuth2Info(), $redirectUri, $offline, $extra_para);

I have one more Question under enhancement.
I am not getting any user information by calling Oauth 2.0. For e.g. user email.
For this i need to add any other scope. So how i can add other scopes?

Thanks,
Chirag

Original comment by chirag.e...@gmail.com on 24 Jul 2013 at 4:56

GoogleCodeExporter commented 8 years ago
We're looking into adding a config parameter for the approval_promt setting.

Can you explain what service you're calling that is not returning a user email?

Regards,

- Paul, AdWords API Team.

Original comment by api.pmat...@gmail.com on 26 Sep 2013 at 6:14

GoogleCodeExporter commented 8 years ago
Hi,

I'm trying to calling CustomerService.
CustomerService that will give me idea about customer who tryed to get data 
using API.
This will help a lot when user is using MCC account for authentication, and 
adwords account has no CompanyName / Name info.

Original comment by chirag.e...@gmail.com on 26 Sep 2013 at 6:31

GoogleCodeExporter commented 8 years ago
Also, I requested you to Add all beta feature to be available for all developer.

Original comment by chirag.e...@gmail.com on 4 Oct 2013 at 5:04

GoogleCodeExporter commented 8 years ago
We have moved to GitHub, please continue discussion here:
https://github.com/googleads/googleads-php-lib/issues/5

Original comment by vt...@google.com on 14 Jan 2014 at 5:21