iosoauthlinkedin-api

LinkedIn API: The token used in the OAuth request has been revoked


I am getting the following error when I use the linkedin V1 API:

response body: {
  "errorCode": 0,
  "message": "[unauthorized]. The token used in the OAuth request has been revoked. 75--5cfb9cdb-3c9c-47c2-b3f8-XXXXXXXX",
  "requestId": "I2GQ0ZMWIE",
  "status": 401,
  "timestamp": 1408976297742
}

I am using this guide here, I am doing exactly what this person is doing but I get a different result:

https://github.com/PrincessPolymath/LinkedIn-OAuth-Sample-Client

I have no idea why I get The token used in the OAuth request has been revoked. for an error. The HTTP request is identical. Could it be something with my bundle ID?

I cannot find anything from linkedin on the matter. Why don't linkedin have normal error-code lookups like other API's.

Here are some photos of the two request objects, one from the example and one from mine.

Example app My app


Solution

  • The issue was code re-use.

    As stated in the comments for the API, the API will give you a token and secret upon the first request. This only happens during authentication and then the token and secret can basically be thrown away, and the one issues at developer.linkedin can be used.

    I fixed this by constructing my own request object rather than relying on the old HTTPRequestBody in the oAuth process.