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

oauthcallback.html#access_token=... #3

Open
ajbraus opened this issue Apr 14, 2014 · 6 comments
Open

oauthcallback.html#access_token=... #3

ajbraus opened this issue Apr 14, 2014 · 6 comments

Comments

@ajbraus
Copy link

ajbraus commented Apr 14, 2014

I am getting the login page from facebook but then after logging in the page turns white and the URL reads:

http://localhost:8000/www/oauthcallback.html#access_token=CAAIvBrMklb0BAAhOZCPXtDxmoSCWJAneA51hEYxeA3ZBF8YRsL2HTHebkI19aDuxri3U2WimKBgRZBi5JCYx2agpkxP66U5Ep2M5q5UNACyeJudZAEtqkk9LCsVa0EY8D4S4vjFtUx6CU7MqsrANgtFfOMdsgH1025QNNVz05h4cZAn0b4O2EJHJfZB4pKXDEZD&expires_in=6288

and the page says:

Error response

Error code 404.

Message: File not found.

Error code explanation: 404 = Nothing matches the given URI.

@ajbraus
Copy link
Author

ajbraus commented Apr 24, 2014

Any ideas? Thanks for whatever help you can give.

@theptrk
Copy link

theptrk commented May 26, 2014

It depends how you set up your routes. The facebook redirect is returning you to your redirect url with an attached access_token. The OpenFB library seems to parse it on line 125 and save the token.

Also, cd into your www directory and run your local server from there for more predictable results.

Do you have a public repo for your project?

@slikk66
Copy link

slikk66 commented Aug 7, 2014

Ran this succesfully in Cordova, but after the login, it seems to take me to:
https://www.facebook.com/connect/login_success.html

I assume that I should be taken back to the app... it looks like I need to pass a 2nd parameter into OpenFB.init(APP_ID, [NEW_REDIRECT_URL]); but for the app, what should this be? Is it like:

[NOT_SURE_OF_DOMAIN?]/index.html#/app/login-success

Can anyone help me out?

Thanks!

@theptrk
Copy link

theptrk commented Aug 7, 2014

Its been a while, Ill look into it but just make sure you that you have inappbrowser installed and make sure that you are loading your index.html file from the same directory as your redirect.

If your Facebook redirect is http://localhost/openfb/oauthcallback.html
Serve your index from http://localhost/openfb/index.html

@slikk66
Copy link

slikk66 commented Aug 7, 2014

Yea I think I was missing the inappbrowser.. I had added it but not rebuilt it. I rebuilt it and now it seems to work,

Just FYI, I modified the logout functionality in the files to get it to do a full logout (i.e. switch user). I know this can be cleaned up ,but I had logout serve a deferred event like the login, using a similar setup to post in and logout the user as well as discarding the local token. Seems to work for me in Cordova.. havent tested it on the web version yet.

controllers.js
http://pastebin.com/75rbrAX5

openfb-angular.js
http://pastebin.com/0x5p60Nf

@theptrk
Copy link

theptrk commented Aug 7, 2014

That sounds like a safer transaction in terms of user privacy. What was your reasoning for changing it?

I don't have merge access to this repo but maybe if you may a pull request and @ccoenraets for him to take a look.

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

3 participants