问题
We seem to be experiencing a really strange problem when attempting to retrieve Instagram access tokens on the server side.
We're seeing "No matching code found" errors at random times, but when it does happen it seem to be clumped, as in these errors aren't spread throughout the day but only seem to be within a random 15 minute or so period late in the night, and it's only happening for a very small percentage of users during that time as we can tell.
We've looked at other possibilities, access token request IP seemed to be one possibility, however this issue is not consistent across all users in the time frame of which these "No matching code found" 400 errors are being returned during the access token request.
Has anyone experienced this before? Any ideas? Also to note, our application sees thousands of users logging in per day at any given time, so the randomness of the timing occurrence doesn't make much sense.
回答1:
It looks like users get more than one code
, and you see first code
, but need second
. Try relogin
users, if you gets error. User will not see instagram page with confirm button, just redirections.
Possible algorithm of error:
1. User click auth link.
2. Get first code.
3. User click auth link (twice, redirection problem, public auth system, etc.)
4. Get another code (even on the same client_id, redirect_uri).
5. You get first code.
6. But first code already doesn't exists.
来源:https://stackoverflow.com/questions/30225811/instagram-oauth-returning-no-matching-code-found-at-random-times