Facebook login through Instagram: Error validating verification code - facebook

I am using a web view (in an iOS Swift app) to let the users to login to their Instagram account or Facebook account to later get their display name to use it in my app.
I have an Instagram app (added inside a Facebook app in Meta for Developers console's dashboard), I finished setup for this Instagram app in the section: Instagram Basic Display -> Basic Display in the dashboard, and I got it to work well ONLY if I login with an Instagram account (added in the Instagram Test Users section), but when I try to login using Facebook (by pressing on the "Login with Facebook" button) and finish the login flow, calling the method https://api.instagram.com/oauth/access_token fails with the following error:
{
"error_type": "OAuthException",
"code": 400,
"error_message": "Error validating verification code. \
Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request"
}
I double checked that I use the same redirect uri in both methods:
https://api.instagram.com/oauth/authorize
and
https://api.instagram.com/oauth/access_token
which is simply as this one: "https://my-domain.com/" (with a trailing slash)
I also set the same exact redirect uri in Facebook Login and Instagram Basic display in the console's dashboard.
The following options are enabled in Facebook login console:
Enforce HTTPS, Embedded Browser OAuth Login, Client OAuth login, Use Strict Mode for redirect URIs, Web OAuth login and Login from Devices.
I tried to use the Facebook client id and secret instead of IG's but to no avail.
any thoughts are appreciated.

Related

Facebook Recent Logins breaks OAuth flow

I'm having troubles working with what appears to be an error with Facebook's OAuth server-side flow. When logging into Facebook using "Recent Logins", Facebook does not redirect back to my calling application. Instead it goes directly to the Facebook home page.
If I login to Facebook using the email/password fields at the top right of the screen, then the redirection becomes successful.
Is there some way to force facebook to send users to it's main login page and not this main page that displays the recent logins when they are not already logged into Facebook?
This also occurs using Facebook's very own OAuth for developers. So I know it can't be just me.
Login to Facebook.com
Logout
Visit facebook's apps page
Click your profile pic and enter your password (rather than using the blue banner to login).
Facebook redirects you to their home page rather than this page
What would be great is a parameter to this page that would allow me to force a particular facebook login dialog as a workaround.

FB login with devise

I am using devise in my rails app and doing FB login via oauth
I am successful in doing login from laptop but not through chrome android
Error url is https://m.facebook.com/v2.11/dialog/oauth?client_id=1709176549128219&redirect_uri=http%3A%2F%2Fconsiliumnsit.herokuapp.com%2Fusers%2Fauth%2Ffacebook%2Fcallback&response_type=code&scope=public_profile%2Cemail&state=c96b3d4ce6d9afd513a8239307092ef7be4c6a2c6888765b
When you created your app in facebook developer console you added a redirect uri. The request you are currently sending is coming from a url that you have not currently added. Go edit your project and add it
http://consiliumnsit.herokuapp.com/users/auth/facebook/callback
its on the left facebook login -> settings look for Valid OAuth redirect URIs you can add more then one

post facebook feed on Flash AIR Desktop using AS3

I need to share Facebook feed using https://graph.facebook.com/me/feed, so I searching and researching until I stumble upon FacebookGraphAPIDesktop.swc. But I failed to login, I already populate the required field (APP_ID, APP_ORIGIN) and make an adjustment on facebook app page too (App Domains & Site URL).
I already init the FacebookDesktop class and try to make a login connection using
var permissions:Array = ["email"];
FacebookDesktop.login(onLogin, permissions);
But it show popup windows contain JSON Invalid redirect_uri, OAuthException, code: 191
Any direction for dong this? bassically I need to show facebook OAUTH login popup and show feed dialog after the login success.
The environment is Flash AIR 17 running on Desktop (not mobile)
When working with Facebook for desktop and not using your own backend servers for login support, set the redirect URI to to https://www.facebook.com/connect/login_success.html.
If you are using your own servers, then the redirect URI should be set to the page that is going to handle the response from Facebook.
In either case, you will need to make sure that you log in to your app on the Facebook developer portal and set the app settings for desktop login and set that redirect URI in there.

facebook extended permission

i have created a sample test app in developers.facebook.com to access notifications for a facebook account in my WebApplication.
When i try to get the accesstoken by navigating to this url
https://graph.facebook.com/oauth/authorize?client_id="+clientId+"&redirect_uri="+redirectURI+"&scope=manage_notifications
from my facebook account for the first time i get oauth dialog where in i login with my facebook login-id and password. Then a popup appears telling me that the app requires access to your basic profile details. Then when i click ok i get one more popup asking me to authorize manage_notifications for this app. When i click ok i am redirected to my web application homepage where i can see list of all notifications for my account.
Now when i try to navigate to the above url and at the oauth dialog, if i login with another Facebook Account i get only a popup saying that the app requires access to my basic profile details but not the popup requesting manage_notifications. And when i click ok i am redirected to my webapp homepage. And i get an error message saying i dont have extended permissions - "manage_notifications"
How do i access notifications for any user in my web application.
All permissions except
public_profile
user_friends
email
require a review of your app by Facebook before you can use them publically. See https://developers.facebook.com/docs/apps/review/login#do-you-need-review

Facebook User Authentication in C#/WPF?

I am new to Facebook app development and have stumbled across a road block. After reading the documentation, I sort of understand that the process of using Facebook login is done in there steps: user authentication -> app authorization -> app authentication. I see where the app authroization/authentication is done, but I can't seem to figure out how to bring up a "user login" screen of Facebook on my WPF. Can anyone advise? Thanks!
First of all you need to register a application in Facebook. Don't forget to give a canvas url when registering an application. After registration you should get app id and app secret values.
https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL
YOUR_APP_ID means your application id
YOUR_URL means that application canvas url.
Wpf has a web browser control, you just call the Navigate function and give this url. You should get a Facebook login dialog.
After giving the correct user id and password, Facebook should popup a permission dialog then click the Allow button , you should get a code with redirect url. Then you should parse the code from this url and create a web request to get an access token:
https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL& client_secret=YOUR_APP_SECRET&code=THE_CODE_FROM_ABOVE
YOUR_APP_ID is application id
YOUR_URL is application redirect url
YOUR_APP_SECRET means application secret
THE_CODE_FROM_ABOVE code get from above.
After executing this request, you should get an access token. Using this token you can access Facebook functionality from your application.