CPCStrategy / bing-ads-sdk-php

Composer friendly version of the Bing Ads SDK for PHP
Apache License 2.0
7 stars 9 forks source link

Is there authorise BingAdsAPI by console? (not through web-browser) #19

Closed maxlen closed 9 years ago

maxlen commented 9 years ago

Hello. I use this package, and everything is ok. But is there authorise BingAdsAPI by console? (not through web-browser) Because I don't see it.

Thanks

onema commented 9 years ago

I'm not sure what you mean. Do you want to authorize your application using a console application?

Bing uses OAuth2 to give application access to protected resources. OAuth2 describes several ways to provide an application access to these resources. The one I know is implemented by bing is the 'authorization code grant', and you can see an example on how to implement it here: https://msdn.microsoft.com/en-US/library/dn632721.aspx.

I recommend using this particular authorization method to get the access tokens, and use a refresh token to avoid going through the process in the future.

I am not sure if Bing supports any of the other grants (implicit, password credentials, or client credentials).

You can read more about obtaining authorization with OAuth2 here: https://tools.ietf.org/html/rfc6749#section-4.

I hope this information is helpful,

maxlen commented 9 years ago

Yes. I'm already using this link (https://msdn.microsoft.com/en-US/library/dn632721.aspx). I wrote my code by bing examples. And after I go by link like https://login.live.com/oauth20_authorize.srf?client_id=***&redirect_uri=***&scope=bingads.manage&response_type=code&state=*** I got auth page with empty form. But I want to authorise automaticaly without filling auth form manually. Do you know how can I do it?