App is misconfigured for Facebook login: Android F

2019-01-01 15:19发布

I have integrated my application with Facebook, and for this I am using Facebook's Graph API. I am retrieving profile and friends information. It is working fine on my device which has Android 2.3 (Gingerbread), but recently my client has faced an issue while he is trying to connect to Facebook through my app. He has Android 4.0 (Ice Cream Sandwich) on his device. When he clicks a button on the app that takes him to the Facebook login screen, after login he gets a message:

My app is misconfigured for Facebook login. Press Okay to go back to the application without connecting to Facebook.

Facebook error message

I am not getting what is the problem whether it is related to Android version or what.

How can I fix this problem?

18条回答
看淡一切
2楼-- · 2019-01-01 15:37

Usually this problem could be solved with two check:

  • flag in the facebook console to publish live the facebook configuration
  • api key mismatches
查看更多
美炸的是我
3楼-- · 2019-01-01 15:38

It's a keystore issue..configure your eclipse to use the same keystore for which app was configured for.

查看更多
素衣白纱
4楼-- · 2019-01-01 15:39

From what I could gather, it's a Facebook problem and has been reported. But, the problem persists.

A way around this (tested on 2.3.3) is to hack on the Facebook SDK, seach for the 2 authorize methods and change the DEFAULT_AUTH_ACTIVITY_CODE to FORCE_DIALOG_AUTH. This will disable the Single Sign On feature.

If your prefer got to

public void authorize(Activity activity, String[] permissions,
            int activityCode, final DialogListener listener) 

and disable the startSingleSignOn part. It's preferable not to, because eventually Facebook will solve the problem, and you only have to put the old constant back.

EDIT

This solution raises security problems. Check Jesse Chen answer.

查看更多
笑指拈花
5楼-- · 2019-01-01 15:40

Although late, still useful: *Here's the corerct way to do(for debug key, change accordingly for release):*

keytool -exportcert -alias androiddebugkey -keystore "C:\Users\<User>\.android\debug.keystore" > <Drive letter>:\debug.txt
openssl sha1 -binary "<Drive letter>:\debug.txt" > "<Drive letter>:\debug_sha.txt"
openssl base64 -in "<Drive letter>:\debug_sha.txt" > "<Drive letter>:\debug_base64.txt"

The hash is in the last generated file: debug_base64.txt....open it and copy the hash.

Remember to replace "" and with your username and drive letter of your choice

查看更多
情到深处是孤独
6楼-- · 2019-01-01 15:41

On Debian system like ubuntu use the keytool of java found under directory /usr/lib/jvm/jdk*.*.*/bin/keytool and generate like this

/usr/lib/jvm/jdk1.7.0/bin/keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

This way you get the authentic hash key that can be put under your app hash of facebook.

查看更多
看风景的人
7楼-- · 2019-01-01 15:41

I had a similar problem, but for iOS.

The solution is to do with configuring the Facebook app on the Facebook developer daskboard.

For iOS, 2 things must be done:

  1. Enabled Facebook Login

  2. Bundle ID must be the same as the app

查看更多
登录 后发表回答