Oauth Token BAD_CLIENT_ID missing or unknown client id


#1

I am attempting to get started integrating my app with HS. I created a developer account, I created an app, got my client id and secret key and in my app am trying to test authenticating with oauth.

I seem to be able to authorize just fine and get a code but when I try to get a token:

POST /oauth/v1/token HTTP/1.0
Content-Type: application/x-www-form-urlencoded
Authorization: Basic ZTgwYjE,etc,etc==

grant_type=authorization_code&code=********-****-****-****-************&redirect_uri=https%3A//www.myawesomeapp.com/oauth2/authorized

I get returned:

{ "status":"BAD_CLIENT_ID", "message":"missing or unknown client id", "correlationId":"c60a89e0-e2ed-46a2-ba88-cb1155586f52", "requestId":"583c60f05303aa86bfbe841625d89598" }

I’m authorizing using one of the test portals I created via the developer tools if that helps. Thanks!


#2

Ok this was my fault. I was not passing the client_id and client_secret as parameters in the request. For some reason I was under the impression I needed to use the Authorization header with the client_id and secret base64 encoded together. Adding the parameters to the request makes everything work well.