Login using Facebook Authentication - FBApp Installed - facebook

I am following the Scrumptious sample that is on the FB Developers site (https://developers.facebook.com/docs/tutorials/androidsdk/3.0/scrumptious/authenticate/) I successfully implemented everything up to the end of step 2 without any errors.
But i noticed that if i have the Android FB Application installed on my device then it does not log in.
It asks permission to access my public profile and friend list (to which i reply OK). After that it execute onSessionStateChange() but state = CLOSED_LOGIN_FAILED.
I did verify that:
My app is listed on https://developers.facebook.com/apps
I checked and my Native Android App option is ticked
i also have my Package Name, Hash Key entered.
The Facebook Login option is also enabled.
Please can someone help me to get this working :-( i am
struggling with this for 2 days already and no luck.
Thanks.

Problem has been resolved. After i generated the HashKey using the KeyTool.exe and entered the password as android it gave me a different key. I copied this to the dashBoard on Facebook and it worked. Sorry for wasting your time

Related

xamarin facebook authentication no longer supported for android

following the microsoft examples as documented here:
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/data-cloud/authentication/azure-cosmosdb-auth
Everything is fine up to the point where I run the xamarin forms app to log in using facebook to get a token.
The error from the emulator when I try to login is this:
For your account security, logging in to Facebook from an embedded browser is disabled. To continue, download and log in to Facebook app on your device and try again.
I have tried downloading the app on the emulator, but that makes no difference, my facebook app is in development state but even then it should at least get me to the login page and allow using a test user.
It seems that facebook stopped supporting android login using embedded browsers from 5 October 2021. See here:
https://developers.facebook.com/blog/post/2021/06/28/deprecating-support-fb-login-authentication-android-embedded-browsers/
Would it be possible to please update the sample with either b2c or with an alternate method or details of how to get facebook auth working again?
If anyone have examples that someone new to these concepts could follow that would be great.
Thanks in advance!

Facebook SDK Login - Application Unavailable: The application you're trying to use is either no longer available or access is restricted

A user tried to login to my app using Facebook login and they encountered the following error after being redirected to their native Facebook app: "Application Unavailable: The application you're trying to use is either no longer available or access is restricted".
I'm not able to reproduce it and I haven't found much online. The app is available since it's live under Facebook apps and it's being used by existing users. The only option would be that the access is restricted but I'm not sure why. I do know that Facebook launched a security update in March to "Use Strict Mode for Redirect URIs" by default, but this update does not apply to the Facebook SDK according to what I read.
I had the same error message on Android devices which was caused by setting only development key hashes solved it by adding release key hash, following these instructions: Setting a Release Key Hash on facebook
This error is also produced if you try to sign up with recently created account. It seems like Facebook has some approval process which takes time. For me new account produced an error one day and worked perfectly on the next one.
To test sign up immediately you should create a test user in Facebook App Dashboard under Roles.

Facebook Testers Can't run my Facebook Dev Canvas App

I have taken the following steps:
On the Facebook dashboard, I created a Facebook App.
Also on the dashboard, I created a test app as a child of the Facebook app (the Dev version, for testing).
I uploaded a build of my app, and confirmed I could run it from the
admin account.
I gave two of my real-world Facebook friends the Tester role in the
dashboard.
When the real-world friends try running the app, they get 404 errors
"the requested URL was not found on this server" when it tries loading
"https://apps-APP_ID.apps.fbsbx.com/hosted-canvas/e30=/.
I am using Facebook's Simple Application Hosting. The url for the app is "https://apps.facebook.com/APP_ID". When the admin hits this it works fine, when the Tester hits it they get the error. Some have suggested that there is a sandbox setting that needs to be turned off, but I see no such thing in any of the settings on the Dashboard. Any insights you could offer would be greatly appreciated.
Not sure if it helps anyone figure it out, but the app consists only of a data file, a Javascript file (xxx.js), and an index.html.
Holy moly - alright I'm hoping this helps someone else out. Apparently, when you create an app, and then create a test app so that you can establish a dev environment for testing - which is standard procedure - you have to add any testers to the parent (production) app under "Roles". I was only adding it under "Roles" for the test app, which apparently is not enough. If anyone from Facebook is reading this, please update your docs, or update the dashboard to issue a warning to people who only add testers under the test app.
We also have to push the app to production (though yet to approved),
If the status is set to "testing", only admin user can find it in my case.

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

Windows Phone Facebook app not returning access token after V 8.3.1.0 Update

I allow my windows phone app users to login using their Facebook account. To authenticate the user and get the access token, I follow the steps provided in this link. It opens up the installed Facebook app on windows phone, authenticates the user and returns an access token. This was working until Facebook recevied V 8.3.1.0 update. Now it opens up the facebook app and comes back with following error:
/Protocol?encodedLaunchUri=msft-<my_app_id>://authorize?error=&error_code=2005&error_description=Calling+app's+ID+doesn't+match+the+ID+sent+by+the+calling+app&error_reason=Calling+app's+ID+doesn't+match+the+ID+sent+by+the+calling+app&state="
What went wrong here? Any deep link changes by facebook?
Found a solution.
When we create a Windows Phone project in Visual Studio, it would assign a Product Id to our app. That Id will change once the app is published on the store.
When we define custom Uri scheme in WMAppManifest.xml file, we have to always specify the published app id. Otherwise facebook authentication would fail.
This new facebook app is expecting the calling app's product id to be same as published app id that is mentioned in the custom uri scheme. Since it won't match in our local app, it is returning the error stated above. I changed the Product id to published app id and everything works fine.
This might help if someone is facing similar issue.