相关疑难解决方法(0)

适用于ASP.NET MVC应用程序的最佳OpenId API

我正在开发一个ASP.NET MVC应用程序,我想使用OpenId.

什么是最好的选择?

  • DotNetOpenId
  • RPX
  • 其他???

有谁知道StackOverflow使用什么?Login UI是自定义开发的,还是由API /服务提供的?

openid asp.net-mvc

46
推荐指数
2
解决办法
7498
查看次数

在ASP.Net MVC3中使用OpenID,我在哪里获取用户数据?

我发现OpenID有点像一个庞大的,或者比典型的注册形式更复杂,但我觉得我在这里缺少一些东西.

根据这个问题,我应该保存我的提供商给出的唯一标识符密钥.

提供商将为每个用户提供一个唯一的ID - 您需要保存.这是您将刚刚登录的用户与数据库中的记录进行匹配的方式.

我的代码中(取自MVC部分),这个唯一的ID在LogOn()action方法的开关内给出:

public ActionResult LogOn()
{
    var openid = new OpenIdRelyingParty();
    IAuthenticationResponse response = openid.GetResponse();

    if (response != null)
    {
        switch (response.Status)
        {
            case AuthenticationStatus.Authenticated:
                FormsAuthentication.RedirectFromLoginPage(
                    response.ClaimedIdentifier, false);  // <-------- ID HERE! "response.ClaimedIdentifier"
                break;
            case AuthenticationStatus.Canceled:
                ModelState.AddModelError("loginIdentifier",
                    "Login was cancelled at the provider");
                break;
            case AuthenticationStatus.Failed:
                ModelState.AddModelError("loginIdentifier",
                    "Login failed using the provided OpenID identifier");
                break;
        }
    }

    return View();
}

[HttpPost]
public ActionResult LogOn(string loginIdentifier)
{
    if (!Identifier.IsValid(loginIdentifier))
    {
        ModelState.AddModelError("loginIdentifier", …
Run Code Online (Sandbox Code Playgroud)

c# openid dotnetopenauth asp.net-mvc-3 steam

10
推荐指数
1
解决办法
2190
查看次数

标签 统计

openid ×2

asp.net-mvc ×1

asp.net-mvc-3 ×1

c# ×1

dotnetopenauth ×1

steam ×1