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

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.

Related

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.

Using Facebook Authentication

In my Angular2 app I have used the following code:
loginfb() {
this.afAuth.auth.signInWithPopup(new firebase.auth.FacebookAuthProvider());
}
But the problem is I am getting an error App Not Set Up: This app is still in development mode, and you don't have access to it. Switch to a registered test user or ask an app admin for permissions.
So I went to Facebook developers, created an app, added the Facebook Login product, went to the product's settings and set the Valid OAuth redirect URIs with the URI given in the firebase console.
But even then when I am trying to login, I am facing the same error.
Any help would be greatly appreciated. Thanks.
This error comes when your app is not live.There are a bunch of possible things which could trigger this error.I am not sure and as you are getting error "you don't have access to it",may be you are trying to login through your test version of the Facebook app and you may have not added the user Roles as Testers in Roles section and the you have to add the email address of the Facebook account you are trying to login in setting section.
Then ,make sure that the user you added accepts the request sent before you try to test otherwise it will fail.
And for error "Switch to a registered test user or ask an app admin for permissions."
When you create new app on Facebook, its by default only visible to you and not to public and others won't be able to use it for social login and they will get this error. You may have to go to Go to your Facebook app's dashboard, Select the "Status and Review" tab and set YES or ON.
You can find similar question and answer is there in this link App Not Set Up.and
This app is still in development mode

Facebook Login for Windows Phone

I need some help regarding issues in Logging In to my App using the process described in the following link-
https://developers.facebook.com/docs/facebook-login/login-for-windows-phone/
Its the new way of logging in using the Facebook app for windows phone.
So following the guide, here's what I have been able to accomplish -
Prepare the fb app by entering the Product id
Invoking the Login dialog by launching the Uri as follows -
fbconnect://authorize?client_id={your-facebook-app-id}&scope={permissions-requested}&redirect_uri=msft-{ProductID}://authorize
The fb app opens and asks my app on fb for access to basic info and friends list.
I / User grants the required permissions.
My app on windows phone opens again - the problem is here.
The FB app should open my app by requesting a uri - as described in the "Before You Start" section in the above link.
I have setup my app to register for uri association as described here -
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206987%28v=vs.105%29.aspx
I have done this step correctly - I checked this by creating another app and launching my app through Uri association. Its as follows -
Uri uriToLaunch = new Uri("my-app-id:fblogin?access_token=12345678",
UriKind.RelativeOrAbsolute);
Windows.System.Launcher.LaunchUriAsync(uriToLaunch);
I get the access token by the above method.
But this does not happen through the fb app.
So is my understanding of the process of logging in using fb correct??
If so, what might I be doing wrong? if not, then what am I doing wrong??
all help is greatly appreciated.
thank you
SOLUTION:-
I setup wrong Uri association. It must be as follows -
<Protocol Name="msft-43245dd584d84cde837aa19a4a2e3914" NavUriFragment="encodedLaunchUri=%s" TaskID="_default" />
In the "Name" field, it must be like msft-{Your-ProductID-Here}
This login flow will work only on phones which have beta version of facebook installed on them . So it wont be advisable to use this method for login. Still theres an article that describes how you can implement facebook login using Uri association. Link

Facebook Test User unable to access my web page

I am trying to test the Facebook login feature for a website staging environment, but when logging in with a test user I see this error message:
Error
User is not allowed to see the application.: The user is not allowed to see this application per the developer set configuration.
I have set App Domain to http://www.mysite-stage.com/. I've also added a Website platform for my app and set the site URL to http://www.mysite-stage.com/.
The website http://www.mysite-stage.com is actually accessible to everybody on the web, so there should be no issues there.
This method of testing Facebook integration for the site was working up to about 1-2 months ago, so I'm a little confused as to why it's not working anymore.
Are you sure you created the test user for that application?
Facebook won't let you login as a test user that was created under a different app than the one you are trying to sign in with.
Facebook test users are app-specific.
Yo can also create test users through the facebook developers site:
http://developers.facebook.com/apps/
- Select your app
- Roles
- Test Users
Since I can't add a comment yet, the problem is with you having made your app available to the public but you are trying to sign in with a test account.
Have you tried using the
installed=true
parameter once you use
POST /{app-id}/accounts/test-users
to create the Test Users? See https://developers.facebook.com/docs/graph-api/reference/app/accounts/test-users#publish

Login using Facebook Authentication - FBApp Installed

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