Facebook authentication failed

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Hi,

Does someone has facebook authentication problem? Facebook stop API 2.2 these days. However, after we upgrade to 2.3, the issue remained. Here are some info we got.

https://developers.facebook.com/bugs/1598154160212440/

https://developers.facebook.com/bugs/268863623571714/

It seems we have to rewrite facebook authentication part using Microsoft.Owin.Security.Facebook 3.1.0-rc1.

BTW, we also tried nop 3.9 and it has the same problem.

Any ideas?

Thanks a lot.
7 years ago
I also have the same Problem.

FacebookApplication.VerifyAuthentication(_httpContext, GenerateLocalCallbackUri()) code is not working.


Let us update on the issue.
7 years ago
Everyone is have same problem. I'm lookin blogs and stack topics for quick fix. When i found something write here.
7 years ago
Hello guys, few days age our web have same problem, but tomorrow it fixed, The point at assembly<DotNetOpenAuth.AspNet.Client>, There have method is QueryAccessToken to bulid facebook auth api return data string .
The original code is get data from encodeString, but the auth api v2.2 to v2.3 is change data string to JSON(because the RFC),So...program get the null exception and login failed.


I have record detail issue on my blog
https://jianshihchao.tumblr.com/post/159028459493/net-oauth-fail-on-facebook-v22-to-v23-auth-api
7 years ago
Yes, if you are a developer you should change the answer from plain string to JSON.
Overwrite method in original class and work with the answer as JSON.
We have such problem in our plugin SocialLogin too.
Facebook wrote us that it planed to stop old API, but I didn't see any information about this changing (fix).
It's interesting, but only Facebook used string for the answer. Another services (ex. Google, Twitter, etc.) used JSON.
May be Facebook developers decides to use standard code.
7 years ago
foxnetsoft wrote:
Yes, if you are a developer you should change the answer from plain string to JSON.
Overwrite method in original class and work with the answer as JSON.
We have such problem in our plugin SocialLogin too.
Facebook wrote us that it planed to stop old API, but I didn't see any information about this changing (fix).
It's interesting, but only Facebook used string for the answer. Another services (ex. Google, Twitter, etc.) used JSON.
May be Facebook developers decides to use standard code.


That right, v2.2 api is stop and the v2.3 change string for JSON, If want to fix this problem, rewrite the method AccessToken in Assembly(DotNetOpenAuth.Asp) FacebookClient class
https://developers.facebook.com/docs/apps/changelog
7 years ago
shihchao wrote:
Hello guys, few days age our web have same problem, but tomorrow it fixed, The point at assembly<DotNetOpenAuth.AspNet.Client>, There have method is QueryAccessToken to bulid facebook auth api return data string .
The original code is get data from encodeString, but the auth api v2.2 to v2.3 is change data string to JSON(because the RFC),So...program get the null exception and login failed.


Hi shihchao,
can you post the compiled dll here?
I cannot compile the source code
Thank you
7 years ago
Update:

Last night I made a change in the DotnetOpenAuth library.
The changes were all in the FacebookClient.cs source file. Here they are:
Definition of the following class:

public class FacebookTokenInfo
  {
    public string access_token;
    public string token_type;
    public long expires_in;
  }


Updated the QueryAccessToken method (at the end of the function):

System.Web.Script.Serialization.JavaScriptSerializer jser = new System.Web.Script.Serialization.JavaScriptSerializer();
FacebookTokenInfo token = jser.Deserialize<FacebookTokenInfo>(data);
return token.access_token;
//var parsedQueryString = HttpUtility.ParseQueryString(data);
//return parsedQueryString["access_token"];


It should work, but the problem now is that I cannot recompile the DLL
Anyone can help me?
7 years ago
Try to use this plugin Social login.
https://www.nopcommerce.com/p/1101/external-authentication-via-facebook-twitter-google-linkedin-microsoft-live-etc-16-networks.aspx

If you need to recompile standard nop plugin I can do it on Monday. What nopcommerce version do you use?
7 years ago
foxnetsoft wrote:
Try to use this plugin Social login.
https://www.nopcommerce.com/p/1101/external-authentication-via-facebook-twitter-google-linkedin-microsoft-live-etc-16-networks.aspx

If you need to recompile standard nop plugin I can do it on Monday. What nopcommerce version do you use?


I am using version 3.20
Thank you!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.