Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9073773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:29:42+00:00 2026-06-16T18:29:42+00:00

About week ago Facebook login on my website worked correctly, but now when I’m

  • 0

About week ago Facebook login on my website worked correctly, but now when I’m trying retrieve access token using “code” I get error “This authorization code has been used“. I’ve checked a lot of docs and suggestions, but without any result.

Steps to reproduce(used FB PHP SDK):

  1. Send user to FB auth with correct urlencoded return uri(with trailing slash):

    https://www.facebook.com/dialog/oauth?client_id=[my_cid]&redirect_uri=http%3A%2F%2Fmydomain.com%2Fauth%2Ffacebook%2F&state=e15e0894cd922098f9f8f340c820538d&scope=email&display=page
    
  2. Receiving code param on my redirect uri(everything goes fine)

  3. Sending request for access token:

    https://graph.facebook.com/oauth/access_token?client_id=[my_cid]&redirect_uri=http%3A%2F%mydomain.com%2Fauth%2Ffacebook%2F&client_secret=[my_secret]&code=[long_code_goes_here]
    

I tried also not urlencoded redirect_uri.

Why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:29:43+00:00Added an answer on June 16, 2026 at 6:29 pm

    This is due to Facebook changes that have been optional up until now but will roll out 12/5/12 for everyone. From the Developer Roadmap for the Dec ’12 breaking changes:

    New security restrictions for OAuth authorization codes
    We will only
    allow authorization codes to be exchanged for access tokens once and
    will require that they be exchanged for an access token within 10
    minutes of their creation. This is in line with the OAuth 2.0 Spec
    which from the start has stated that “authorization codes MUST be
    short lived and single use”. For more information, check out our
    Authentication documentation.

    So, when you first get an access_token for a user, you need to store it and then explicitly set it the next time the user needs to interact with the FBAPI: $facebook->setAccessToken($theToken);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

About a week ago, I was rebasing some commits while trying to clean up
I asked a similar question about a week ago, except now I'm having a
I asked this same question about a week ago, but I might not have
I'm studying the Laravel 3, 1 week ago, but didn't understand everything about the
I just noticed this about a week ago. I'm storing data about the current
I started Objective-C programming about a week ago and am stuck on creating a
I've just started learning Java (about a week ago) and the last few days
My disclaimer here is that I started teaching myself C++ about a week ago
About a month a go I spent almost an entire week trying to figure
I've been learning wpf for about a week now.. and i have a basic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.