在MVC应用程序中使用Open OpenId

时间:2014-01-12 19:15:05

标签: asp.net-mvc openid steam

我之前从未做过openid应用程序。我确实看到MVC 5有一些内置的oauth标志。我能够让这些工作没问题,因为它们已经建成了。

但我完全不确定如何在MVC中使用steam openid工作。有没有人有一些MVC Steam OpendID的示例代码?或者有人知道一个很好的教程吗?

2 个答案:

答案 0 :(得分:11)

转到工具>库包管理器>包管理器控制台并键入:

Install-Package Owin.Security.Providers

打开App_Start \ Startup.Auth.cs,然后添加:

using Owin.Security.Providers.Steam;

然后,在ConfigureAuth方法中,添加:

app.UseSteamAuthentication("your API key");

您可以从http://steamcommunity.com/dev获取API密钥。

应在您的登录页面添加“Steam”按钮。

答案 1 :(得分:1)

这是一个关于如何将openid与ASP.NET MVC集成的优秀教程,它确实有工作代码和说明。请看看然后开始。

http://weblogs.asp.net/haithamkhedre/archive/2011/03/13/openid-authentication-with-asp-net-mvc3-dotnetopenauth-and-openid-selector.aspx

希望这有帮助。