I am building a Javascript application using Basecamp3 API with authentication OAuth2. I started by register my app at https://launchpad.37signals.com/integrations in order to provide my redirect_uri
and get my client_id
& client_secret
to configure my OAuth 2 library.
Everything seems to work when I launch my app. I am able to get the Basecamp login, and give access to my Basecamp 3 data.
However, when the configuration is done, the window closes and I do not have access into my app.
I checked the log, and I saw an error 400:
error: 2019-03-27 02:59:55.5955 Error when requesting api key StatusCodeError: 400 - {"timestamp":1553716795279,"status":400,"error":"Bad Request","message":"Bad request","path":"/thirdparty/proxy/oauth2/requestTokens/"}
It looks like I cannot get a token, so I changed the actual link https://launchpad.37signals.com/authorization/token
to https://launchpad.37signals.com/authorization/token?type=web_server
like I did for the first link for the authorization (explained here)
But I still get an error, but error 500:
error: 2019-03-27 02:56:16.5616 Error when requesting api key StatusCodeError: 500 - {"apierror":{"status":"INTERNAL_SERVER_ERROR","timestamp":"27-03-2019 07:56:16","message":"Unexpected error","debugMessage":"could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.DataException: could not execute statement","errors":null}}
I even tried to change the protocol https
to http
. I still get an error 500:
error: 2019-03-27 03:05:15.515 Error when requesting api key StatusCodeError: 500 - {"timestamp":1553717115170,"status":500,"error":"Internal Server Error","message":"Error requesting from http://launchpad.37signals.com/authorization/token?client_id=1111111111111111111111111&client_secret=22222222222222222222222&code=abcdef&redirect_uri=http%3A%2F%2Flocalhost%2Foauth%2Fredirect&grant_type=authorization_code; got HTTP response HTTP/1.1 307 Temporary Redirect","path":"/thirdparty/proxy/oauth2/requestTokens/"}
I tried to change my request in many ways, it doesn't work.
I tried to get a token with Postman (same way I am trying to do with my app), and I cannot.
Do you know where this error comes from?
I have found a solution. The problem came from how I used curl
in command line in order to create a POST request. I put the elements inside the url instead of using --data
option.