Cant Use Facebook API on AppEngine - facebook

So, I have this grade project where I have to do a mashup and deploy it on AppEngine. So, everything is fine, and I even got it working some months ago, but when I deployed the project again after doing some changes and updating the facebook api, it no longer works.
Thing is, it does works on localhost. The error only occurs when deployed. It's only a normal publish post POST.
So, here's the error:
The URL was blocked: Redirection has failed because the URI is not incluided in the list of OAuth authorised of the application client. Check that the OAuth access of both client and web are active and add all the domains of your apps as OAuth redirection URI
This was translated from spanish so it might not be totally accurate.
So, it seems easy, but I don't really know if the proble is that I have to do something in the configuration of appengine control panel (most likely), in the configuration of the facebook api control panel or if it's something in the project code. I've checked everywhere and have the faint memory of solving this several months ago, but I can't anymore.
Thanks!

For Facebook login, you need to tell Facebook the URI of the page that the login will start from. If you change the URI, then the login process will break. You can set the URI from this page:
https://developers.facebook.com/apps/1234567890/fb-login/
Except that you need your app id in there instead of 1234567890. You can get there from here:
https://developers.facebook.com/apps

Related

Have no idea why Facebook login doesn't work

Have no idea why Facebook login doesn't work. Tried all answers to similar questions.The weirdest thing is that there is another app with same settings which works just fine. Maybe there is some kind of update I don't know about.. App runs locally on http://127.0.0.1:8000
Added facebook login product and in value OAuth redirect URLS entered everything possible: localhost, http://127.0.0.1, http://127.0.0.1:8000
Made app public, tried also creating test app. In app domains it's localhost and in Site Urls I tried both localhost and localhost:8000
EDIT: FB init doesn't even work. So no response to debug or something
And anyways I get this error:
Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings.
Id and code is correct. The same works on different project(Checked id, all comas and etc). What else could be theoretically wrong? At least does the error mean what it says The domain of this URL isn't included in the app's domains. ?
Same problem here, Just started happening with no warning.
I was using .Net Identity 2.0 with Microsoft.Owin.Security.Facebook 3.0.1 however it seems Facebook may have deprecated support for this.
The only symptom I got when debugging is that the call to AuthenticationManager.GetExternalLoginInfoAsync() returns a null which is extremely not useful.
In the end I upgraded to the release candidate using the NuGet Package Manager Console command "Install-Package Microsoft.Owin.Security.Facebook -Pre"
If you're using .Net with this package then I recommend you test this solution in a staging environment first and see if it fixes the issues (and that it doesn't cause any new issues).
it's the FACEBOOK APP PLATFORM in settings
I had my disabled and kept getting error
I enabled the app platform and it works.
enter image description here

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.

Has anyone actually got ASP.NET MVC 5 Identity Facebook logins to work out of the box? (loginInfo always returns null)

Using Visual Studio 2013 Update 5, I have created a boilerplate MVC 5 application with Individual User Accounts auth option selected, and I have been trying to implement social logins using the template code, but have been unsuccessful.
I have ensured all NuGet packages are up to date, and the code is using MVC 5.2.3; Owin 3.0.1; AspNet.Identity 2.0.0.
I can get everything working fine, including authenticator apps using OtpSharp, but the Facebook login is just not working whatever I try.
I have created the Facebook App, set all the relevant options on that and set the AppId and AppSecret in my Startup.Auth.cs file.
When I try to login with Facebook, the MVC site redirects me to Facebook, which prompts me with the auth screen for the app. I click OK and accept this then I am redirected back to the MVC app. If I check the authorised apps under my Facebook account, my app is listed and shows that it has granted permission to the app to retrieve email address.
The callback works fine but when it hits ExternalLoginCallback and in particular:
var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync()
loginInfo always returns null.
Looking at the Request it shows an error of access_denied:
https://localhost:44301/Account/ExternalLoginCallback?ReturnUrl=%2Fmanage&error=access_denied
I have read pretty much every blog post and SO question on this error and whilst most of them are helpful, most are also out of date and not relevant.
It would seem that something is missing from the templated project, or something has changed elsewhere as no matter which tutorial I read, and options I set, the result is the same.
I have tried this internally on a dev machine running IIS Express and externally on a hosted machine running IIS 7.5 too and the results are the same.
I've even decompiled the Microsoft.Owin.Security.Facebook library to see where that particular section of the querystring is set to no help.
If I had any hair I'd have pulled it all out by now.
I'll take any suggestions. Can anyone help?
Facebook loves to make things difficult. Access_denied sounds like they are blocking you on purpose. Check your developer dashboard and the accounts authorized to test your app while its in development mode. The email permission is approved by default, so that isn't your issue.
Make sure the account you are testing with is added here:
If that doesnt solve it, make sure you have the correct app domains (testing and live) listed in the domain section here:
I had the exact same issue. No matter what I did the facebook would show the login, get permissions and then return back to the Login page instead of the Email confirmation page.
Using Fiddler Facebook would invoke "http://localhost:1234/signin-facebook&code=SOME_SECRET_CODE_HERE", and then my application's controller would invoke "http://localhost:1234/ExternalLoginCallback?error=access_denied". I was sure Facebook is refusing the access. It was only after implementing a Facebook Javascript SDK Sample, I realised I could successfully login and also view FB scopes!
My Dev environment
MVC 5 application
Visual Studio 2013 Community edition Update 5
Microsoft.OWIN v2.2.1
Microsoft.OWIN.Security.Facebook v3.0.1
Finally I found a YouTube Video by ProCoder which mentioned to put the correct path in the Valid OAuth redirect URIs as http://localhost:1234/signin-facebook and it worked. If you haven't already added, you will need to add Facebook Login product to your Facebook app.
I also set App Domain to localhost and Site URL to http://localhost:1234/
I have added 127.0.0.1 and MY.EXTERNAL.PUBLIC.IP to the Server IP Whitelist Under Security in the Advanced Settings option of the Facebook app.
All these settings I replicated in a new MVC 5 application and it worked like a charm.
update the package Owin.Security.Facebook 3.0.1 to 3.1.0
It works for me

How do I get access to my client ID and auth? Original developers moved on

OK, here is my situation. We had two developers create a Social Networking program for us. They created a feature that allows it to link to your Facebook account. They said they used a the standard Facebook API and that it uses a token for authorization. The feature worked great when the code was on our dev site, dev.maizing.com, but now that it is on www.maizing.com we are having a problem.
I searched and found one PHP file that had several references to dev.maizing.com and I changed them to www.maizing.com In our app now when I try to link to my Facebook account, I get a long error url. I noticed it includes ....
https://www.facebook.com/dialog/oauth?client_id=____________
I won't include the whole client_id here.
What I was told is that my original client ID was hardcoded to work with dev and not www. My original developers are gone and are unreachable. I think they have the client_id under another account and I don't have access to it. Have can I get the access to now make our
client_id point to the right server?
Your AppID shown on your app dashboard page is the client_id.
Sounds like you need access to the apps settings, found here:
https://developers.facebook.com/apps/[client_id]/summary/
As this page says, "The URL you specify must be a URL with the same base domain specified in your app's settings..."
So unless you get access to your app settings, you have to stay with "dev.maizing.com"
Sorry.
There is a silver lining though, if you change your app domain to "maizing.com" instead of "dev.maizing.com" then you can us this app from "*.maizing.com" as stated on the tool tip for app domain.

Facebook newbie - can't login to application - gettin an error with no helpful information

I'm trying to implement my first Facebook application, and I'm stuck on the very first coding step.
I created an application on the Facebook website, I got my application ID and I'm doing an ASP.NET app to test the authentication. It has just one line:
Response.Redirect(
"https://www.facebook.com/dialog/oauth?client_id=MYAPPID&redirect_uri=localhost");
When I run it, it redirects to facebook and I get:
An error occurred with MYAPPNAME. Please try again later.
It fetches the app name, so the ID is correct and there is very little else that I could have got wrong :-)
I also tried using other URLs instead of localhost, and I'm currently arranging for a VPS to try it with a publicly deployed web app in case it doesn't work with a local one.
Searching only found me lots of posts complaining about similar issues - but not the same one. I found this question that looks quite similar, but the confirmed answer speaks about editing FB.init() which is I guess part of some SDK, so not applicable for me.
Your redirect uri must be a url that is within the domain that you configured in your application set up. As noted in the documentation.
"The redirect_uri must be within the same domain as the Site URL you specify in Web site tab of the Developer App"