MicrosoftDocs / Advertising-docs

Creative Commons Attribution 4.0 International
15 stars 59 forks source link

Following the guide, getting missing 'client_secret' #369

Closed pentium10 closed 6 years ago

pentium10 commented 6 years ago

I did obtained a DeveloperToken, changed Env to Production, have obtained an application id and added Native app to the app, saved the page, and used the app-id as ClientId in PHP, no ClientSecret as not sure what is that. Getting this error.

$ php ReportRequests.php
You need to provide consent for the application to access your Bing Ads accounts. Copy and paste this authorization endpoint into a web browser and sign in with a Microsoft account with access to a Bing Ads
account:

https://login.live.com/oauth20_authorize.srf?scope=bingads.manage&client_id=<EDITED>&response_type=code&redirect_uri=https://login.live.com/oauth20_desktop.srf

After you have granted consent in the web browser for the application to access your Bing Ads accounts, please enter the response URI that includes the authorization 'code' parameter:

https://login.live.com/oauth20_desktop.srf?code=<EDITED>&lc=1033

Error: invalid_client
Description: The provided request must include a 'client_secret' input parameter.
You need to provide consent for the application to access your Bing Ads accounts. Copy and paste this authorization endpoint into a web browser and sign in with a Microsoft account with access to a Bing Ads
account:

https://login.live.com/oauth20_authorize.srf?scope=bingads.manage&client_id=<EDITED>&response_type=code&redirect_uri=https://login.live.com/oauth20_desktop.srf

After you have granted consent in the web browser for the application to access your Bing Ads accounts, please enter the response URI that includes the authorization 'code' parameter:

https://login.live.com/oauth20_desktop.srf?code=M<EDITED>&lc=1033

0

#0 U:\fls_warehouse\bigquery\vendor\microsoft\bingads\src\Auth\OAuthWithAuthorizationCode.php(110): Microsoft\BingAds\Auth\LiveComOAuthService->GetAccessTokens(Object(Microsoft\BingAds\Auth\OAuthRequestParam
eters), 'Production')
#1 U:\fls_warehouse\bigquery\bingads\AuthHelper.php(165): Microsoft\BingAds\Auth\OAuthWithAuthorizationCode->RequestOAuthTokensByResponseUri('https://login.l...')
#2 U:\fls_warehouse\bigquery\bingads\AuthHelper.php(150): Microsoft\BingAds\Samples\V12\AuthHelper::RequestUserConsent()
#3 U:\fls_warehouse\bigquery\bingads\AuthHelper.php(78): Microsoft\BingAds\Samples\V12\AuthHelper::AuthenticateWithOAuth()
#4 U:\fls_warehouse\bigquery\bingads\ReportRequests.php(58): Microsoft\BingAds\Samples\V12\AuthHelper::Authenticate()
#5 {main}

Have tried on two PHP versions, even in Windows PHP and on Ubuntu PHP.

$ php -vPHP 5.6.25 (cli) (built: Aug 18 2016 11:39:15)
Copyright (c) 1997-2016 The PHP Group

and

# php -v
PHP 7.2.7-0ubuntu0.18.04.2 (cli) (built: Jul  4 2018 16:55:24) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.7-0ubuntu0.18.04.2, Copyright (c) 1999-2018, by Zend Technologies

composer.json

{
    "require": {
        "microsoft/bingads": "v0.11.12.5"
    }
}

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

eric-urban commented 6 years ago

Closing as duplicate of 368.