I have noticed that after expiration of Facebook GRAPH API on March 27, 2017 my Facebook application is not providing the access to my web application.
Mainly OAuthWebSecurity
is failed to fetch the login state from the facebook graph API, I have gone through the bug report in the developers group. But they didn’t provide a solution. I got a solution which is provided for NopCommerce
in this link. However I didn’t get any perfect solution for MVC 4
.
I have gone through this link where they system is approached in MVC 5
however I need the solution in MVC4
And mention that OWIN
is not supported for MVC4
in VS 2012
So how do I solve this problem. I have been undergoing this problem since last 1 week.
Mainly the exception is happening in this piece of code
AuthenticationResult result = OAuthWebSecurity.VerifyAuthentication(Url.Action("ExternalLoginCallback", new { ReturnUrl = returnUrl }));
It’s returning IsSuccessful
as false and rest of the parameters are null as well.
I have studied that Facebook have changed the the return type of the API string
to JSON
So how to develop my code to get those JSON
exactly. thank you.
Update:
This Question is still unanswered. Anyone here to help me.
2
Answers
Have you checked this solution?
“We ran into this same issue on Monday, 3/27/2017, when Facebook discontinued support for their Graph API v2.2.
We are also using DotNetOpenAuth, which was originally installed via Nuget. The source code is available at the link below”
FacebookApplication.VerifyAuthentication(_httpContext, GenerateLocalCallbackUri()) return null on Facebook
Edit (Apr 18, 2017):
Hello, I’ve came across the following link this morning and it solved the issue for me. Give it try and let me know 🙂
https://github.com/DotNetOpenAuth/DotNetOpenAuth/issues/397
The code is provided by the user ‘adoconnection’. it’s the 4th post in the link.
I was pulling my hair over this. lol
Best regards!
According to Previous Answer I got to give you a solution. In
MVC4
everyone write down theirAppID
andSecurityCode
. Due to change of facebook GRAPH API those previous links are broken. Consequently everyone need to change theRegisterFacebookClient
calss. But this class is a sealed class in the .Net library, so anyone can’t extend or overwrite it. As a result we need to use awrapper
class. Let us consider my Wrapper class isFacebookClientV2Dot3
therefore my class will beLook here you I have replaces all the API links by newer version links.
Now you need to modify your
Just use a wrapper class
Then all success. You facebook login will be back in previous state.
However you can face a new issue regarding this new API rather than previous API, the problem is that
IP Whitelisting
. Like this image. Hope you will need nothing but this. Happy coding.