3

I've received the following exception against both the test and production APIs.

Exception: Unable to validate App Keys(ClientID/ClientSecret) provided: {'errorcode': 1, 'message': 'Unauthorized', 'documentation': ''}

We've been using Sentry to log the errors so I've seen this exception 31k times. I've ensured that I have the correct client id and client secret in all environments. The request seems to work fine to initially retrieve an access token, but then fails when refreshToken and scope are included in the json request payload.

2

It appears that this is an issue specific to the Python FuelSDK and requires a change to the SDK itself. The SDK is attempting to refresh its access token using the scope parameter, which causes the request to fail.

  • Andrew, were you able to verify that with your local code base? – Drew Simmons Feb 25 '15 at 21:08
  • Yes. Once I refactored that code, the issue stopped occurring. – Andrew Lewisohn Feb 26 '15 at 22:24
  • Can you share your refactor here or create a pull request on the SDK? – Drew Simmons Feb 27 '15 at 1:28
  • My refactor is in our python3-support branch of the FuelSDK, which appears to be abandoned. Here's the commit: github.com/sfx/FuelSDK-Python/commit/… – Andrew Lewisohn Feb 27 '15 at 15:55
0

From the doc:

  • Only use the refreshToken parameter in the payload if you need a new contextualized token

  • The refreshToken provided (from the JWT) MUST NOT have been used previously, or we will receive a 401 Unauthorized

  • If you're using the scope parameter (deprecated) while requesting a new accessToken and you want to contextualize the accessToken to the logged in user, the internalOauthToken you're using MUST NOT be expired (the expiration time is denoted in the JWT.request.user.expiresIn value, which is in seconds)

Here's an example payload structure you should follow:


{"clientId": "", "clientSecret": "", "refreshToken": "", "accessType": "offline"}

~~~

I recorded this as an issue on the python-sdk git. Have you tried removing scope key/value pair at client.py:184?

  • I'm using the Python FuelSDK maintained by ExactTarget. I don't access the request at that level. – Andrew Lewisohn Feb 24 '15 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.