facebook external login not redirect back - facebook

I have a MVC5 application with external login. When I use Facebook login, after I put in my login information into facebook login page, facebook fails to direct me back to my application.
I got a white page with the following URL in Chrome's URL bar:
https://www.facebook.com/dialog/oauth?response_type=code&client_id=632877723495196&redirect_uri=http%3A%2F%2Flocalhost%2FMPOS%2Fsignin-facebook&scope=email&state=l2oJwWdkbRsgZHyr6-5lL9ZTZc-eMbRBkH73L-h1ZN_MWvWriNeEdCxuNspi4QptZAna60SQIJX4NB5AItzP6NxpDCz10m48JInWUfvQGWkgFgZhZNFIaTz6ju-kEQ-RyiObgiMOKvBougeeaSHD7CAzTrvc1Gj6XdGgGbUgyrM9d1KZUEGbqh_MdyBPg4wTFbQEiui-2GzvcIvhOVtTRC12NnhgnVyLCrrKEDFaWdU
If I use IE, I got "The website cannot display the page" error page with the following URL on the borwser's URL bar:
https://www.facebook.com/login.php?login_attempt=1&next=https%3A%2F%2Fwww.facebook.com%2Fv2.1%2Fdialog%2Foauth%3Fredirect_uri%3Dhttp%253A%252F%252Flocalhost%252FMPOS%252Fsignin-facebook%26state%3DWbWcYquZJnjvo8Db42l6goqpMUrioHL6HBVIUMu74QvqMuAjNzWizophJhNpf3NHCbw1-Dw1tsdgmv2h1f0ct1zcLJ_jlSXQ3ImCHVN_PXRkRedVB3gjTQb59-tbxPKxJQTuNhPvOKLq6aBjakP_fJDw5zXKZ55LrRzHVzEQ39Qff7WXsNJpke2BTHILHLI0I5jcWiXEgE-HeH7La19ttaL9LhrcyXP4DBiWaXuUNZc%26scope%3Demail%26response_type%3Dcode%26client_id%3D632877723495196%26ret%3Dlogin
Anyone has an answer to this problem? Thanks!
Thanks Nathan, clear cache on browser didn't help. I tried to clear cache/cookies on both IE and Chrome several times before I post the question.
The weird thing is that if I create an app under my personal facebook account and use the FacebookAppID/FacebookAppSecret for my app, the external login works fine. That's how I did all my testing.
But when I try to deploy the website I want to create the app under company's facebook account. I set up the app under the company's facebook account exactly the same way as I did when using my personal facebook account, then I got this redirect problem. If I switch back the FacebookAppID/FacebookAppSecret to the one I created under my personal account, everything works fine. That's even more puzzling.

I finally figured out the problem. I forgot to turn on "make this app and all its live features available to the general public" setting for the app I created in Facebook. So the login was only available to the developer who created the app. After I turn that setting on (it is under the Status and Review Tab), everything works fine.

Related

Post image to facebook from desktop application

I have this desktop windows app written in C#
The user can post an image to his wall from the app. I have already created the Facebook app. In the previous version the win app would upload the image to my web site then the user was directed to https://www.facebook.com/dialog/oauth/ (via Process.Start(…) that would open the default browser) with my Facebook apppid and a redirect_uri and after authentication and obtaining an access_token the post image dialog would open. It all worked fine.
However, my question is if I could do these stages without a web site of my own, directly from c#.
I have seen plenty of examples but most of them refer to aspx, php and javascript but after all this is a few http request so I think it should be possible.
I think the main problem is how to get an access_token if there is no web page that the user is directed to after login.
I have seen an example using the webbrowser control but it wasn't very clear. And also, if possible I rather that the user would login using their default browser where they are most likely already logged in to Facebook and don't need to enter user and password just for this.
Also, is it possible to upload an image to facebook directly from my app without putting it on some public url first.
Any help would be appreciated. Thanks

Facebook API login error

When I'm trying to log in with my facebook button on asp page (jdk) I'm getting this error:
App Not Setup: This app is still in development mode, and you don't have access to it. Switch to a registered test user or ask an app admin for permissions.
I've tried so many solutions available online, but its not working.
So, my login java script is "http://localhost:8003/en/user/login/".
The things that I set on the facebook app are: contact mail, site url:"http://localhost:8003/"
Valid OAuth redirect URIs "http://localhost:8003/".
I have set option "Do you want to make this app and all its live features available to the general public?" to yes.
Does anyone have any idea why it isn't working?
So i made it work. I feel ashamed that it took me soo long to figure it out.
Just had to put javascript for FB login in master page and it is available everywhere on website and localhost:port/ work as valid Valid OAuth redirect URI.

Why cannot others see my app/use my app

I have created a facebook canvas app. It embeds a web site (which is fully functioning for several months).
If I paste the app url in browser, only I can see the app. But when any of my friends type https://apps.facebook.com/XXXXXXXXXXXXXXXXXXXX, they are not able to/allowed to see the page. Even when they are logged in as facebook user, they are not allowed to see the app page.
(I have implemented facebook login using javascript in my home page)
Can anyone give any hints.
Go to "Settings & Review" in the App Settings, there is a checkbox to put the App live. Else, only users with a role in the App can use it.

App on Facebook mobile gives me 4oh4 / 404

we have created a Facebook app, but when opening this on a mobile (via Web or iPhone) the page results in a 4oh4 error. I have setup a Mobile Web URL but still (after 1 hour wait) gives a 404.
Do I need to make specific changes on my app?
Please help.
This is expected as #Igy stated. You will need to have a handler to support redirecting mobile users to your apps.facebook.com/ or you can redirect them out of Facebook to your own URL if you are going to try and link to your page directly with an app embedded as a tab.
i.e. point link to http://yoursite.com/redirector
is mobile goes to http://yoursite.com/myapp or http://apps.facebook.com/
non mobile goes to http://facebook.com//app_
Some things to note:
You won't get any page specific data back from facebook on your page (i.e. Liked or Not Liked).
Based on #1 you won't be able to restrict the non-liking app users from a page.
After trying everything under the sun to get Facebook to redirect to a mobile web URL, here is what I needed to do in order to get the redirection working:
Make sure the Facebook application is a canvas application. This gives you the ability to give the application a namespace.
Give your application a namespace so that you can access it through https://apps.facebook.com/NAMESPACE. From here, Facebook will do the detection for you, and if needed, redirect your users to your specified mobile URL.
Make sure your app is NOT in sandbox mode.
If your app is in Sandbox Mode, Facebook won't redirect you to the mobile version you have specified in your app settings.
Facebook does the redirecting for you, you don't have to. Although their version of what "mobile" is and what you deem "mobile" might be different.

Problem with Old Facebook JavaScript SDK

I have an issue with the old sdk. Whenever I try to authorize a new user I get redirected to the home page of my app in the iframe. However, after I close the iframe and refresh the page, I can easily authorize a user.
But whenever I delete the application from my facebook account and try to authorize it, I'm back to the previous problem.
I've noticed the same bug in the different web applications. Hootsuite could be a good example.
Did facebook change the old api or did they change the authorization proces lately ?
I have a bug report open with Facebook for this. Go add your comment and vote it up.
http://bugs.developers.facebook.net/show_bug.cgi?id=12260