Facebook/ Twitter with dotnetopenauth? [closed]

柔情痞子 提交于 2019-11-26 06:00:02

问题


I\'ve pretty much got OpenID working using the DotNetOpenAuth library. Now I would like users to be able to use Facebook and Twitter to login.

This requires OAuth so I am looking for a tutorial on how to use DotNetOpenAuth OAuth.

I\'m having trouble trying to find some simple tutorials on how to do this.

Can anyone please help?


回答1:


At the time of me answering this question, DotNetOpenAuth has a public Community Tech Preview (CTP) which is available to download.

  1. Download that source code. Should be a .7z file. You can use 7-Zip to unzip the code if you don't already have it (it's free).
  2. Open up the samples source code solution in Visual Studio. I'm using VS2010 but I think there's also a VS2008 solution file.

  1. Now, open up the web.config file for the OAuthClient project.

  2. Next, edit the following settings :-

    <!-- Facebook sign-up: http://developers.facebook.com/setup/ -->

    <add key="facebookAppID" value="------"/>

    <add key="facebookAppSecret" value="------------"/>

You can get these values from your application on Facebook.

  1. Debug/Run the OAuthClient Web Application. This will start an instance of Cassini/Visual Studio Developer Server and a web browser should open:

Voilà! you can now connect to Facebook to log in.

If you get errors, then you need to make sure that:

  1. You've manually changed the Facebook app settings in your web.config file.
  2. You've correctly setup your app settings in the Facebook developer website.


来源:https://stackoverflow.com/questions/4821747/facebook-twitter-with-dotnetopenauth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!