OAuth2 Request Access Token w/ Basic Authentication

Some OAuth2 token endpoints want the Client ID/Client Secret to be included using HTTP Basic Authentication.

For example, we can look at the documentation for the GoToMeeting API at https://goto-developer.logmeininc.com/how-get-access-token-and-organizer-key
You’ll see this under the “2 – Request Access Token”  in the GoTo API documentation linked above:

curl -X POST "https://api.getgo.com/oauth/v2/token" \
  -H "Authorization: Basic {Base64 Encoded consumerKey and consumerSecret}" \
  -H "Accept:application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=authorization_code&code={responseKey}"

When the token endpoint desires Basic Authentication, set Chilkat.OAuth2.UseBasicAuth = true.

For example, the QuickBooks API also requires it:  https://www.example-code.com/csharp/quickbooks_oauth2_desktop_app.asp

Tags :