I'm having a hard time retrieving an access code from Exact Online. My GET request looks like this:
GET /api/oauth2/auth?client_id=CIENTID&redirect_uri=http://example.com/oauthcallback&response_type=code HTTP/1.0
User-Agent: Drupal (+http://drupal.org/)
Host: start.exactonline.nl
My client id and redirect uri are exactly the same as shown in the Exact Online developers console. The response is 200/OK witch assumes the request was succesfull. However, the data retrieved from the request consists of HTML, instead of someting like ('access token = ************').
I've tested my code with te Facebook API, by changing the endpoints to the fb endpoints and the client id to my fb client id. It works flawless, because the data in the response contains an access code instead of HTML.
What could be the problem?
I'm sure you've fixed this by now. But incase others get the same problem.
The page you see from Exactonline is their authorization page. The easiest solution is instead of trying to print the html, just redirect to the url you are doing a GET on. You will be forwarding your user to an Exact hosted login page; Once the user has submitted their login details to that page, it will redirect you to your callback url (that you specified using redirect_uri). That call back url will have the parameter 'code' on it, which will contain your access code, which you can use to request tokens.