Bing Ads Password Authentication RRS feed

  • Question

  • Hi,

    I am using given example for download the Bing keyword-performance-report-in-csharp.

    code given in this URL on MSDN.

    I am using Password Authentication and passing the user name, Password, CustomerId, AccountId and Developer Token as per given example but i am getting an error.

    105: Authentication failed. Either supplied credentials are invalid or the account is inactive.

    on my profile, i am super admin and my account is active and user name and password is also correct.

    could you please help me what can i do to authenticate the user using Password Authentication process and download the that report.

    Wednesday, September 16, 2015 1:08 PM

All replies

  • Here are some suggestions to verify first.

    • Are you using a legacy username i.e. not an email address? If the username is an email address (Microsoft account), then you must use OAuth. For more information, please see Managing User Authentication with OAuth.
    • Are you using a DeveloperToken that is assigned to the provided user? Please see Account Permissions and the Developer Token for more information.
    • Are you using a production user for production services or a sandbox user for sandbox services? In other words does the user and targeted environment match?

    Otherwise for credentials verification please feel free to contact support. For more information, see Common Errors and Engaging Support.

    I hope this helps!

    Wednesday, September 16, 2015 1:47 PM
  • Thank you for you prompt response.

    I wanted to ask you one more question. We actually downloaded one more Bing Ads API WPF example to download reports. It is working as well, we provide the client id to it and it asks for credentials in WebBrowser control and generates the access token and downloads the report as well. We provide other values as well in the config file. So everything works fine.

    However, we are creating a console application for downloading BingAdsReport and want to know how we can implement the feature of generating the acess token behind the scenes i.e. without using WebBrowser control.

    Wednesday, September 16, 2015 2:00 PM
  • Initial user consent via a web browser control is required. After initial consent you can use refresh tokens to manage accounts and make API calls without user / browser interaction.

    Whereas the refresh token parameter does not have a defined expiration period, you should expect it to last several months. As a best practice the refresh token should be set to the value of the most recent refresh token retrieved. You may need to request user consent again if, for example the Microsoft Account user changed their password, removed a device from their list of trusted devices, or removed permissions for your application to authenticate on their behalf.

    For more information, see Using OAuth in C#.

    Wednesday, September 16, 2015 2:10 PM
  • One more thing I would like to ask you.

    Why there is a need of Application Client Id for getting Access Token? Can it not be done without any Client Id?

    Wednesday, September 16, 2015 4:25 PM
  • The user will be prompted through the Microsoft Account authorization web browser control to grant permissions for your application to manage their Bing Ads accounts:

    Let this app access your info?
    My Test App needs your permission to:
    Access and update your Bing Ads info
    You can change these application permissions at any time in your account settings.

    The client ID is used by the authorization service to identify the app that you registered and display it for the user of your app e.g. My Test App as shown above.

    Does this answer your question?

    Wednesday, September 16, 2015 4:46 PM