OAuth access token request returns 200 with empty body #24562
-
|
I am building a SPA that needs to retrieve repository files from GitHub. As such, I am trying to follow the instructions at: https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow to authenticate a user prior to making API calls. I have successfully redirected a user, and been returned back with a code. At this stage: https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#1-request-a-users-github-identity The process fails in an odd way. I POST a request using this code: Github is responding with success, but the response body is empty. I have tried posting to the endpoint using PostMan as well, and can see that the response is completely empty (which incidentally crashes Postman if you try to view it raw, but that’s another story). Chrome dev tools show “no response”. Here are the response headers: Note: I initially tried posting the params in the body (which is the correct way to do POST), but changed it to sending query parameters when that did not work. The documentation is very ambiguous on this point, it only lists parameters but does not specify whether they should be query parameters or passed as body, it would be great if that could be remedied as well. There’s 2 issues:
Any help appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Problem is that you can’t do CORS OAuth, so browser will never work. Have to set up a server to do the request, so I cobbled together a little heroku and it works now |
Beta Was this translation helpful? Give feedback.
Problem is that you can’t do CORS OAuth, so browser will never work. Have to set up a server to do the request, so I cobbled together a little heroku and it works now