A Microsoft API that provides programmatic access to Microsoft Advertising to manage large campaigns or to integrate your marketing with other in-house systems.
Hello Toshiyuki,
Thank you for using our Microsoft Advertising Learn Q&A Platform!
Thank you for your query regarding Google OAuth support for the Microsoft Advertising REST API. I understand that you would like clarification on whether IdentityProvider: Google is required and why Google OAuth support was removed from PHP REST SDK version 13.0.29. I hope the response and resources provided here can help you out.
To add Google sign-in support for Microsoft Advertising users in your platform using the REST API (v13), you should follow these steps:
- Register an Application: First, you need to register your application with Google OAuth. This is essential for obtaining the necessary credentials to authenticate users.
- Request User Consent: After registering your application, you must request user consent. Redirect the user’s browser to the Google OAuth 2.0 authorization endpoint with the required query parameters. This process ensures that users can authenticate and grant permissions to your application to access their Microsoft Advertising accounts on their behalf. 1
- Get Access and Refresh Tokens: Once the user grants consent, you will receive an authorization code that you can exchange for access and refresh tokens. When making API calls, include the access token in the request headers along with the
IdentityProvider: Googleheader. This indicates that the authentication is done via Google OAuth. 2 Additionally, ensure to securely store both the access and refresh tokens, as the access token is used for API calls, while the refresh token is used to obtain new access tokens when the current one expires.
For detailed steps, please see the following articles:
Authentication with OAuth - Microsoft Advertising API | Microsoft Learn Get access and refresh tokens - Microsoft Advertising API | Microsoft Learn
Make your first API call - Microsoft Advertising API | Microsoft Learn
Google OAuth authentication for the Microsoft Advertising REST API is generally available and supported going forward. Microsoft Advertising now supports authenticating users with both Microsoft OAuth (Azure identity) and Google OAuth 2.0 as authentication options. This means that you can use Google OAuth for user sign-in alongside the existing Microsoft identity authentication method without any changes to the API request logic. All API requests must still include a valid Microsoft Advertising Developer Token, regardless of the authentication provider used.
Based on the information available in the Microsoft Advertising API documentation, the required headers for API calls include DeveloperToken and AuthenticationToken. While the documentation does not explicitly state that the IdentityProvider: Google header is required for REST calls, it is advisable to include it when using Google OAuth. This practice can help ensure that the authentication method is clearly identified, which may be beneficial across various services such as Customer Management, Campaign Management, Reporting, and Bulk services. Since SDK versions 13.0.26 to 13.0.28 do not send this header, it may not be strictly necessary, but including it could prevent potential issues with service compatibility. Testing API calls with and without this header is recommended to observe any differences in behavior.
No Microsoft Advertising documentation could be identified that definitively confirms whether Google OAuth authentication for the REST API will continue to be supported going forward. The PHP SDK change log you cited shows that its client library has removed the Google OAuth grant classes and related scope constant, but the .NET, Java, and Python SDK release notes, as well as the API release notes, do not mention a deprecation or removal.
Based on the available documentation, it is not possible to determine whether this is a PHP SDK-specific change or part of a broader platform change. If needed, we may be able to raise this matter with our higher-level API engineering team to seek more definitive guidance on whether Google OAuth will continue to be supported for the Microsoft Advertising REST API and whether similar changes are planned for other SDKs.
Our support teams are happy to discuss your account in more detail via phone, chat or email to provide review assistance, please see our support page to reach out!
I hope the information provided here will at least partly answer your questions. If you have any additional questions please do not hesitate to reach out to our support. I have also sent you a private message asking for further details. You are more than welcome to respond to me so that I can begin the investigation on my end.
Kind regards,
Vahid | Microsoft Advertising Support Specialist | 800-518-5689