Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何将现有的基于表单的身份验证替换为adfs 2.0?要添加哪个模块?如何替换FormsAuthentication类信息?_C#_Asp.net_Adfs2.0_Form Authentication - Fatal编程技术网

C# 如何将现有的基于表单的身份验证替换为adfs 2.0?要添加哪个模块?如何替换FormsAuthentication类信息?

C# 如何将现有的基于表单的身份验证替换为adfs 2.0?要添加哪个模块?如何替换FormsAuthentication类信息?,c#,asp.net,adfs2.0,form-authentication,C#,Asp.net,Adfs2.0,Form Authentication,我作为依赖方拥有现有的表单身份验证应用程序。我已将此应用程序配置为ADFS服务器上的依赖方。但ADFS网站没有表单认证 我的依赖方应用程序需要更改哪些内容?我的回答与您的问题一样好,因为您没有提供太多背景信息,例如Visual Studio版本、.NET framework版本、asp.NET版本等 如果您碰巧正在使用VS2010和,那么有一个非常方便的工具叫做Federation Utility Wizard(Federation Utility Wizard,FedUtil),它可以“自动”

我作为依赖方拥有现有的表单身份验证应用程序。我已将此应用程序配置为ADFS服务器上的依赖方。但ADFS网站没有表单认证


我的依赖方应用程序需要更改哪些内容?

我的回答与您的问题一样好,因为您没有提供太多背景信息,例如Visual Studio版本、.NET framework版本、asp.NET版本等

如果您碰巧正在使用VS2010和,那么有一个非常方便的工具叫做Federation Utility Wizard(Federation Utility Wizard,FedUtil),它可以“自动”配置您的应用程序。这正是您所需要的

最后,web.config的标识模型应该如下所示:

<microsoft.identityModel>
    <service>
      <audienceUris>
        <add value="http://localhost:57349/ClaimsAwareWebSite2/" />
      </audienceUris>
      <federatedAuthentication>
        <wsFederation passiveRedirectEnabled="true" issuer="https://<specified STS>/FederationPassive/" realm="http://localhost:57349/ClaimsAwareWebSite2/" requireHttps="false" />
        <cookieHandler requireSsl="false" />
      </federatedAuthentication>
      <serviceCertificate>
        <certificateReference x509FindType="FindByThumbprint" findValue="48BF03FCEDA703DE09E0F1F0CEFED60BB92B3DD8" storeLocation="LocalMachine" storeName="My" />
      </serviceCertificate>
      <applicationService>
        <claimTypeRequired>
          <!--Following are the claims offered by STS 'http://<specified STS>/Trust'. Add or uncomment claims that you require by your application and then update the federation metadata of this application.-->
          <claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" optional="true" />
          <claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/role" optional="true" />
          <!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" optional="true" />-->
          <!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn" optional="true" />-->
          <!--<claimType type="http://schemas.xmlsoap.org/claims/CommonName" optional="true" />-->
          <!--<claimType type="http://schemas.xmlsoap.org/claims/EmailAddress" optional="true" />-->
          <!--<claimType type="http://schemas.xmlsoap.org/claims/Group" optional="true" />-->
          <!--<claimType type="http://schemas.xmlsoap.org/claims/UPN" optional="true" />-->
          <!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier" optional="true" />-->
          <!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/webpage" optional="true" />-->
          <!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/title" optional="true" />-->
          <!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/picture" optional="true" />-->
          <!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/manager" optional="true" />-->
          <!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/department" optional="true" />-->
        </claimTypeRequired>
      </applicationService>
      <issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <trustedIssuers>
          <add thumbprint="5C8885A8E3D29D6BF6C9365E00B1BEA5EB284D1E" name="CN=<specified STS>, OU=US-Federated Identity, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
        </trustedIssuers>
      </issuerNameRegistry>
    </service>
  </microsoft.identityModel>

WIF使用WS-Trust或FedAuth将用户重定向到ADF进行身份验证。 当您使用VS 2010时,您应该安装 -WIF运行时 -用于.Net Framework 4.0的WIF SDK

安装上述工具将允许您使用FedUtil向导创建您的索赔感知应用程序

请参阅以下文章开始:


需要改变的地方很多。您真的应该阅读有关联合身份验证的内容。您好,您能建议什么内容和方式吗?谢谢你的回复。我使用的是VS 2010和WIF 3.5。ADFS没有表单身份验证。现在,我想替换我现有的RP应用程序的身份验证相关代码,例如,如果我现在没有表单身份验证,什么是表单身份验证票?还有FormsAuthentication.FormsScookeName?基本上我不知道如何在代码中使用WSFederationAuthenticationModule和Session Module来访问cookie和ticket以及其他相关信息谢谢回复。我正在使用VS2010和WIF3.5。我已经完成了上面的步骤。现在我想替换现有的FormAuthentication相关代码,比如如果我现在没有FormAuthentication,那么FormsAuthenticationTicket将是什么?还有FormsAuthentication.FormsScookeName?基本上,我不知道如何在代码中使用WSFederationAuthenticationModule和Session Module来访问cookie、ticket和其他相关信息是的,您没有,也不需要它。如果你已经正确地设置了你的应用程序,并且你被重定向到你的STS,那么WIF框架将通过SAM和FAM处理它。看看这个:是的,谢谢!你能告诉我我应该在依赖方中使用FedAuth cookie还是.ASPXAuth cookie吗?由于我现有的应用程序是表单身份验证,但在实现ADFS后,我的RP web配置将是Authentication=“None”,ADFS/ls project web.config将具有“Authentication=Windows”谢谢!我已经完成了这些步骤,但这是一篇好文章。谢谢分享!