Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

API isn't working #1581

Open
adelevie opened this issue Oct 17, 2016 · 3 comments
Open

API isn't working #1581

adelevie opened this issue Oct 17, 2016 · 3 comments

Comments

@adelevie
Copy link
Contributor

We've been getting some C2 API-related errors on Micro-purchase and some digging has revealed that the first step of the OAuth handshake fails:

Request:

MY_OAUTH_KEY=[redacted]
MY_OAUTH_SECRET=[redacted]
MY_CREDS=`echo "$MY_OAUTH_KEY:$MY_OAUTH_SECRET" | base64`
curl -i -X POST -H "Authorization: Basic $MY_CREDS" \
  -d 'grant_type=client_credentials' \
  https://c2-staging.18f.gov/oauth/token

Response:

HTTP/1.1 401 Unauthorized
Cache-Control: no-store
Content-Type: application/json; charset=utf-8
Date: Mon, 17 Oct 2016 15:16:21 GMT
Pragma: no-cache
Server: nginx
Vary: Origin
Www-Authenticate: Bearer realm="Doorkeeper", error="invalid_client", error_description="Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method."
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Request-Id: a8d01689-5020-4840-beba-b4b51261d56d
X-Runtime: 0.012835
X-Vcap-Request-Id: cad626f8-f8eb-4bd7-5965-aee2d898abc7
X-Xss-Protection: 1; mode=block
Content-Length: 173
Connection: keep-alive

{"error":"invalid_client","error_description":"Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method."}%   

We had this same error inside the Micro-purchase app (using the C2::Client class--from https://github.com/18F/c2-api-client-ruby).

@pkarman
Copy link
Contributor

pkarman commented Oct 17, 2016

I assume the oauth key has been authorized in the staging app?

@phirefly
Copy link
Contributor

@pkarman Good question. @adelevie can you clarify -- is this on production or on staging?

@adelevie
Copy link
Contributor Author

adelevie commented Oct 20, 2016

The problem is the same on prod and staging last time I checked (last week). I'll try to check again and doc the results here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants