Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get facebook token via account.js #141

Open
agarmaster1987 opened this issue Apr 6, 2016 · 5 comments
Open

Unable to get facebook token via account.js #141

agarmaster1987 opened this issue Apr 6, 2016 · 5 comments

Comments

@agarmaster1987
Copy link

Hey,

I'm testing around with account.js to get a facebook token. I got the cookies from my friend (datr, c_user & xs) but I'm not receiving an error which should (or could) be called here: req.on('error', function(e) { ret.error = e; if(cb) cb(null, ret); }); and I'm not receiving any token.

I tried to debug it but parsed_token was never send. Tested with:

if(res && res.headers && res.headers.location) {
                res.headers.location.replace(/access_token=([a-zA-Z0-9-_]*)&/, function(_, parsed_token) {
                    if(parsed_token) {
                        account.token = parsed_token;
                        account.token_provider = 1;
                    }
                    console.log("Parsed_token",parsed_token);
                });
                res.headers.location.replace(/expires_in=([0-9]*)/, function(_, expire) {
                    if(expire) {
                        account.token_expire = (+new Date) + expire*1000;
                    }
                });
            }

EXTRA: I'm unable to find my datr cookie. I only have c_user & xs! Anyone know why?

@agarmaster1987
Copy link
Author

Thanks for your test.
I'm receiving this message:
Failed to get token!
HTTP code: 302 Redirect: https://www.facebook.com/login.php?skip_api_login=1&api_key=677505792353827&signed_next=1&next=https%3A%2F%2Fwww.facebook.com%2Fv2.3%2Fdialog%2Foauth%3Fredirect_uri%3Dhttps%253A%252F%252Fagar.io%26scope%3Dpublic_profile%252C%2Bemail%26response_type%3Dtoken%26client_id%3D677505792353827%26ret%3Dlogin&cancel_url=https%3A%2F%2Fagar.io%2F%3Ferror%3Daccess_denied%26error_code%3D200%26error_description%3DPermissions%2Berror%26error_reason%3Duser_denied%23_%3D_&display=page&locale=fr_FR

Where do you got your datr cookie from? I'm using google chrome but I'm not seeing the datr cookie in my 'cookie explorer'

@pulviscriptor
Copy link
Owner

@agarmaster1987
Try to open https://www.facebook.com or http://www.facebook.com
I know there is www used, maybe it will help.

@agarmaster1987
Copy link
Author

Found the issue. In my country (tested it with 3 friends) is the datr cookie called lu. I don't know why and I'm not wuite sure.

@pulviscriptor
Copy link
Owner

Can anybody confirm that xs is renamed sometimes? Should we add this to readme?

@pulviscriptor
Copy link
Owner

@MasonBurdette
Does it have name lu or it can be completely random?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants