Skip to content

no receive callback from facebook #20

Closed
loocaworld opened this Issue May 23, 2012 · 4 comments

2 participants

@loocaworld

I'm trying to receive long-lived access token from facebook.

I checked your codes, and found that this library can trade 'code' to 'access_token' in middleware, "OAuth2ForCanvasMiddleware".

But some codes, i don't understand.

In "middleware.py",

elif 'code' in request.GET and 'facebook' in request.META.get('HTTP_REFERER', u''):
            authenticate(request.REQUEST['code'], fb, application,
                         request.build_absolute_uri().split('?')[0] \
                            .replace(application['CANVAS-URL'], application['CANVAS-PAGE']))

These codes call "authenticate" function. but the parameters not match.
function definition is like this.

def authenticate(app_id, app_secret, code=None, redirect_uri="", type=None):

and I found that sometimes there's no HTTP_REFERER so i can't check whether this request is from facebook, or not.

So those codes are not called.

I'm not good in python, but trying to hack your codes as i want to use.

can you give me any help, or some example django project using this library?

Thanks.

Shim, from Korea

@sbaechler

This code is for the server side login flow.

To exchange an access token for the long-lived there is a new function in facebook.utils called do_exchange_token.
You have to use the 'structured' branch since that one is the current development branch.

Also make sure your configuration is correct as described in the docs (The docs on readthedocs are for the master branch. You have to build the docs for structured yourself, or just read the rst files).

@loocaworld

I've not used 'structured' branch.

I'll try with it. thank you for your help.

@loocaworld loocaworld closed this May 23, 2012
@sbaechler

I just updated the docs on the structured branch and added them to readthedocs:
http://django-facebook-graph.readthedocs.org/en/structured/index.html

@loocaworld

This is really helpful.

Thank you! I'll read it now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.