Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Android sdk throwing missing redirect uri on Authetication

I'm using the Facebook android sdk with my android app. Had everything going fine with my app while developing my dev version. When I finally when to publish my app to the public, the facebook authenication spits a ugly error when people try to authenticate my app:

API Error code: 100
API Error description: Invalid parameter
Error Message: Requires valid redirect URI

Seems like facebook thinks I'm doing a browser redirect to them and missing a redirect uri to return to my app, but I am using the android sdk in which you do not send a redirect uri, you have a callback listener:

facebook.authorize(this, new String[] { "email", "publish_stream" }, new FBLoginDialogListener());

Like i said this all worked fine during development and only showed up after released my prod version, so I have checked both the dev app setup and the prod app setup on fb, and they are both identical.

Anyone else see this issue?

UPDATE: It seems I only get this error when a user accepts allowing to log into my app, but then does not accept my permissions. hmmmmm. Maybe I'm not handling some situation, but the error still makes no sense to me.

like image 861
MattoTodd Avatar asked Oct 11 '11 04:10

MattoTodd


People also ask

How do I change my key hash on Facebook?

Go to your Facebook App --> Settings--> Paste Hash key in "key hashes" option -->save changes. Now Test your android app with Facebook Log-in/Share etc.

How did you integrate the Facebook SDK in Android app?

To use the Facebook SDK in an Android Studio project, add the SDK as a build dependency and import the SDK. Go to Android Studio | New Project | Minimum SDK. Select API 15: Android 4.0. 3 (IceCreamSandwich) or higher and create your new project.

Is redirect failed because the redirect URI is not whitelisted in the app's client OAuth settings?

The error message tells what the issue is: "URL blocked: This redirect failed because the redirect URI is not whitelisted in the app's client OAuth settings. Make sure that the client and web OAuth logins are on and add all your app domains as valid OAuth redirect URIs." This is easily fixed.


1 Answers

I solved this issue by disabling the Enhanced Auth Dialog in the Advanced Settings of your app on https://developers.facebook.com/apps

Best regards

like image 98
Rutger Avatar answered Sep 30 '22 05:09

Rutger