0

在此处输入图像描述

我在 mvc3 razor 代码中实现 OpenID,(我在 razor 中使用 nerddinner openid 示例)我使用 dotnetopenauth ,我在 authcontroller 中得到了这个。我使用大会 DotNetOpenAuth.dll,v2.0.50727

这是我的 web.config

<configSections>
    <section name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection" requirePermission="false" allowLocation="true"/>
  </configSections>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <!-- When targeting ASP.NET MVC 4, this assemblyBinding makes MVC 1 references relink
         to MVC 4 so libraries such as DotNetOpenAuth that compile against MVC 1 will work with it. -->
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

<pages>
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
        <add namespace="System.Globalization" />
        <add namespace="System.Linq" />
        <add namespace="System.Collections.Generic" />
      </namespaces>
    </pages>
4

1 回答 1

0

我试图手动将 aspx 转换为剃须刀代码,这使我的代码运行干净

 var clientResponseInfo = (HttpRequestInfo)HttpRequestInfo.Create("GET", auth, headers: headers);
 response = RelyingParty.GetResponse(clientResponseInfo);
于 2013-05-28T13:55:51.087 回答