GithubHelp home page GithubHelp logo

Comments (5)

uzyn avatar uzyn commented on July 17, 2024

Looks like you're getting an Error 400: Bad Request from Facebook Graph API.

If it fails only some of the time, then it could be Facebook API that's having a problem during that time.

However, you might also want to check if you have openssl enabled at your PHP.

from facebook.

ceeram avatar ceeram commented on July 17, 2024

Could you provide some more information, opauth response should contain additional info like seen here:

http://awesomescreenshot.com/0fb1glkvfd

from facebook.

dall avatar dall commented on July 17, 2024

the error is:

array(
    'error' => array(
        'provider' => 'Facebook',
        'code' => 'access_token_error',
        'message' => 'Failed when attempting to obtain access token',
        'raw' => 'HTTP/1.0 400 Bad Request
Access-Control-Allow-Origin: *
Cache-Control: no-store
Content-Type: text/javascript; charset=UTF-8
Expires: Sat, 01 Jan 2000 00:00:00 GMT
Pragma: no-cache
WWW-Authenticate: OAuth "Facebook Platform" "invalid_code" "This authorization code has been used."
X-FB-Rev: 863722
X-FB-Debug: 4xUcr6QkWu+1iRK7MKRuLNB6s/RrDAjFK55XTEqV7+8=
Date: Tue, 02 Jul 2013 16:40:03 GMT
Connection: close
Content-Length: 97'
    ),
    'timestamp' => '2013-07-02T16:40:03+00:00',
    'validated' => false
)

Invalid code error? it is impossible. I used correct app credentials.

(I only checked Website with Facebook Login in the app settings)

from facebook.

uzyn avatar uzyn commented on July 17, 2024

You are not supposed to reuse the one-time authorization code.

To reauthenticate user, start from the beginning, eg. /auth/facebook

from facebook.

dall avatar dall commented on July 17, 2024

sure, i always start with /auth/facebook

uzyn, maybe i found the problem:

in my AppController i have:

    public $components = array(
        /*'Security',*/
        'Session',
        'Auth' => array(
            'loginAction' => array(
                'controller' => 'users',
                'action'     => 'login'
            ),    
            'logoutRedirect' => array(
                'controller' => 'pages',
                'action'     => 'home'
            ),
            'authenticate' => array(
                'OpAuth',
                'Login',
            ),
            'authorize' => array('Controller')
        )
    );

if i comment 'authorize' => array('Controller') it works correctly! (always).... now i have to understand why this problem.... maybe my custom Authenticate class?

from facebook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.