How to connect to Facebook using DotNetOpenAuth

I searched, read the documents of the FB developers.

MVC 4, I have included OpenId.
Now I want to enable the FB login, just like Stackoverflow and some other sites have implemented it.

Create your own JS file with sample code from the FB developer?
OR
Use third-party tools that I don’t know what to use. I watched OAuthClient (DotNetOpenAuth-4.0.0.11165), it could not work, a server error occurred and could not be debugged because the source file was missing.

+6
source share
3 answers

Facebook implements an older version of OAuth 2 than the latest beta of DotNetOpenAuth. To interact with Facebook, you must use CTP v3.5 DotNetOpenAuth to avoid 400 Bad Request error.

+2
source

In the latest version of DotNetOpenAuth (4.0.0.12084), Facebook login works fine.

To create the Sample assembly: install Code Contracts: http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx

And to make an example of working with Facebook, you need to

  • Create your own Facebook app
  • Specify the local website URL in the application settings (in the "Choose how your application integrates with Facebook" section).
  • Update the Web.config file (OAuthClient project) with your application and application ID.
  • in DotNetOpenAuth.ApplicationBlock.Facebook.FacebookGraph changes the type of the Id property from int to long
  • Run the OAuthClient project. It should work.

Read more here: Facebook / Twitter with dotnetopenauth?

Also read the release notes for OAuth 2.0 ( http://www.dotnetopenauth.net/oauth/dotnetopenauth-4-0-released/ ) As far as I understand, it is not stable yet, but I am studying this. So far, this works great for me.

0
source

This post explains how to enable OAuth and OpenID authentication and integration in an ASP.NET MVC 4 application.

http://www.dotnetexpertguide.com/2012/08/facebook-twitter-oauth-openid-login-with-aspnet-mvc-4-application.html

0
source

Source: https://habr.com/ru/post/907788/


All Articles