-
Notifications
You must be signed in to change notification settings - Fork 11
Valid access token, but every call throws invalid access token #36
Comments
Is it possible your access token has expired? Have you tried retrieving one through the SDK or did you already have one from before? |
This issue is indeed occurring even with a brand new access token attained by authorization. |
Thanks for the reply, I'll look into it later tonight :) |
Just a quick update - when I am running a console command, the call always succeeds on the first try and subsequently always fails (basically refreshing the feed/search) in the same process. Restarting the command always results in the same issue. |
Would it be possible to some sort of a code sample? I'm not having much luck reproducing... |
Actually, I am encountering some more problems with this. Imagine a scenario where I am running calls for multiple users in a single script, each using the user's access_token stored in a database after they gave authorization to the app. Here is a very simplistic snippet from my console command. I believe I have narrowed down the cause to be in
If we intercept and print the access_token in AuthMiddleware, this is the result:
I have found a solution to this in the meantime, that is to declare a new Client with an access_token everytime in the constructor like so:
I'm not sure if this issue is worth exploring further, but this could be a nice-to-know for other users who may have similar use cases. |
Thank you so much for your detailed reply, using multiple access tokens was never something I actually got round to testing. I agree with your assessment of |
I've just tagged 1.2.2 which should solve the issue, please let me know if it hasn't. |
Any luck, @MarSD? |
I'm facing the same problem and the last version has not solved the problem for me. Any other ideas? I've seen the suggestion of using the access token wrapped of a JSON, but that did not work to me aswell. Thanks |
I have been encountering a very weird situation where every call throws an invalid access token exception. I have double-checked the call manually (both with an outgoing sniffer and Postman calls) and it returns expected results.
This has been causing my error log to grow insanely fast. This is the relevant section from the logs:
The text was updated successfully, but these errors were encountered: