Assume that you build a native android app which uses Facebook login. For that first you have to build a Facebook app and configure Package Name, Class Name, Key Hashes of your android app. I assume the authenticity of app is validated through this Key hash. but the problem is after we configure this key in Facebook app, we never configure it in our mobile app or send it to Facebook when we make API calls. So how does the Facebook validates that this is the original app which is making the API call?
Whenever you put an app onto a device (whether via eclipse/IntelliJ or by building a .apk) you're signing it with a key. When you log in via Facebook using SSO, the native Facebook app can get the signature of the calling app, and passes it to the server to get verified.
Related
I am using facebook sdk to request the fb login in my android app.
From what I figured out after reading here, if I have a native fb client installed on my device, than that client gets the signature of my app and then verifies it(or sends it to the server that verifies this) with the key hashes that I have uploaded on my facebook app page.
Now, if I don't have the native facebook app installed, how does it still verifies the same?
I can see a method named setupAppCallForWebFallbackDialog in the ServerProtocol class which calculates the key hash of the current package and passes it to the web dialog.
Now, we know that we can get the signature of any package in android in any app using PacakgeManager.
So, if I clone the facebook sdk from here and then hardcode it to calculate the signature of a particular app and I am using that app's application id in my project, can I ask the user to login on that app's behalf? Am I missing something here?
I have created an app which needs to login with the facebook.
When i connect my device to my pc and run it from android studio then it is works fine.
i am able to connect with facebook sdk and able to login.
But when i create an .apk of my app and install it on my device and other devices then it is not able to login with that.
When i press login button then it goes to facebook page and return to my app screen.
i have done all settings on facebook developer account. my app is live and i have turn on single sign on
So what is the issue with that ? When i run it from studio then it works but when i create an apk and run then it is not working.!!!
When you run app from Android Studio it uses debug key hash to login in Facebook. Did you set Facebook release key hash like it show in their docs?https://developers.facebook.com/docs/android/getting-started#release-key-hash
Typically when you create an apk, you're using a different key to sign the app (whereas debug builds will use the debug key).
This means that you need to update the key hash in your Facebook app settings to also include the key hash of your release key.
I'm having trouble with facebook development key hash.
I try to share content into facebook using Feed Dialog as fallback
as showing in Facebook quick start page. I've already done whole step set for adding facebook SDK in my Android project.
I've set a development key hash of application and add it into "Add your development and release key hashes" field, after I generated debug apk file of application.
Trying sharing with my device where Facebook app is running with my developer account logged (the same on which i've registered the application) all works fine.
When i trying to sharing content with another device where is running Facebook app, but with different Facebook account error
com.facebook.FacebookAuthorizationException: This app has no Android
key hashes configured. Configure your app key hashes at -my application settings page-
My question is development key hash is limited only for developer testing so it works only with developer account interactions?
Ps: I made application public and available to all users on settings account, I set a development key hash given by application installed on test devices, but i didn't set any release key hash.
Login to facebook dev account and go to status and reviews under app sections and tick (Do you want to make this app and its all features available to general public to yes )
you need to define the hash keys on the facebook developer site which will be acheived from ur code programmatically.
it with sync with package name.
You can dive into your app management,and getting started,as such:
https://developers.facebook.com/quickstarts/664900340309697/?platform=android
then it has some steps,you should step by step and config your app's package name and lancher activity just finished.
I am using Facebook SDK 3.0 for authentication. It works fine when facebook app is not installed on the device. If the facebook app is already installed on the device, I am unable to fetch the Access token value.
I am using the same code given in helloFacebookSampleActivity.java in the tutorial.
This is due to the Single Sign-On feature provided by facebook. It allows user to sign in to your app if he/she is already logged-in, in the native facebook app, without having to re-enter the username and password.
To get this working you have to submit your Android key hash to your facebook profile. For more information on this please read the Step 4 given here.
I'm developing an app connected to native Facebook app.
I found that Facebook requires a hashkey of my App in order to connect it to the Facebook native app.
When I export my app using a keystore, there's no problem-I just have to register my hashkey on the facebook app setting console, and it works fine.
However, when I debug my app, Native Facebook App recognizes my app as unregistered. I think this because Eclipse applies different keystore(the default debug keystore) on my app when debugging.
So I made two versions of my Facebook app on the server side-the real one, and the one for my debug-keystore.
I want my app to call the former one when released, and the letter one when debugging.
Is there any way, in Android Java code, to check if the current app is running on the debug keystore?
You can register both two hash key of on the facebook app setting console.
More than one hash key can be setup on a facebook app