Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook: OAuthException: This authorization code has been used
    primarykey
    data
    text
    <p><strong>Background:</strong></p> <p>I know that this question has been asked before, I have gone through all answers I have found, but it seems that no one have given a satisfying answer to it yet. I have seen that Facebook had a bug open about this but closed it due to lack of info. Thats why I ask again to see if someone out there now have found any good solution. </p> <p>I'm trying to get a short-lived access token to be able to get a users profile. This worked fine up until some time ago and now I only get "OAuthException: This authorization code has been used." back from the api call.</p> <p><strong>Technologies used:</strong></p> <ul> <li>PHP (no third part libraries or Facebook SDKs for Facebook API interaction) </li> <li>cURL </li> <li>Graph API</li> <li>https</li> </ul> <p><strong>Logical Flow</strong></p> <ol> <li><p>Get the url for the login dialogue looking similar to this:</p> <p>https://graph.facebook.com/oauth/authorize?client_id=[APP_ID]&amp;redirect_uri=[URLENCODED_REDIRECT_URI]&amp;display=popup&amp;scope=publish_stream</p></li> <li><p>Login through the Facebook login dialogue. On success redirect the user to the specified callback URI and add the "code" quersy-string variable.</p></li> <li><p>When the user is redirected to the specified callback URI it immediately try to get get a short-lived accesstoken with the "code" variable provided by the Facebook login dialogue. I do that by calling this url:</p> <p>https://graph.facebook.com/oauth/access_token?client_id=[APP_ID]&amp;redirect_uri=[URLENCODED_REDIRECT_URI]&amp;client_secret=[APP_SECRET]&amp;code=[CODE_SENT_FROM_FACEBOOK]</p></li> </ol> <p>I receive the following response EVERY TIME: {"error":{"message":"This authorization code has expired.","type":"OAuthException","code":100}}</p> <p><strong>I already know that:</strong> </p> <ol> <li>I shall get a short-lived access token</li> <li>the code is only valid for 10 minutes</li> <li>I can only use the code once (my logging confirm that I only call the access_token request just once)</li> </ol> <p>What have I missed? Why has it suddenly stopped working? Any answer, tip or trick is very appreciated! Thanks in advance. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload