OAuth code example

The following examples show a simple desktop implementation used to get an access and refresh token. The example does not support the recommended state query parameter.

If you use the Bing Ads .NET SDK, you should use it to get your OAuth access and refresh tokens. For information, see Getting Started.

Example Description
CodeGrantFlow A browser control that gets the user's credentials, requests permissions for your application to access their resources, and returns the access and refresh tokens.
Call CodeGrantFlow A test app that shows how to call the CodeGrantFlow DLL to get an access and refresh token.