Asp.net mvc 4 将ASP.NET MVC 4 web应用配置为使用Identity Server 4 P>我不太理解如何使用现有的旧的 ASP.NET MVC 4 应用程序(基于Author的AuthTM、Windows身份基础、WS联邦、旧的TrackTecurity身份服务器),使用WS-FieldApple < /强>使用新的身份服务器4。 它是否需要用OWIN中间件替换WIF的身份验证和会话模块,或者两者都使用

Asp.net mvc 4 将ASP.NET MVC 4 web应用配置为使用Identity Server 4 P>我不太理解如何使用现有的旧的 ASP.NET MVC 4 应用程序(基于Author的AuthTM、Windows身份基础、WS联邦、旧的TrackTecurity身份服务器),使用WS-FieldApple < /强>使用新的身份服务器4。 它是否需要用OWIN中间件替换WIF的身份验证和会话模块,或者两者都使用,asp.net-mvc-4,identityserver4,wif,ws-federation,thinktecture-ident-server,Asp.net Mvc 4,Identityserver4,Wif,Ws Federation,Thinktecture Ident Server,以下是web.config中的配置: <httpModules> <add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf385

以下是web.config中的配置:

        <httpModules>
      <add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add name="SessionAuthenticationModule" type="Microsoft.IdentityModel.Web.SessionAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </httpModules>
...
<microsoft.identityModel>
    <service>
      <audienceUris>
        <add value="https://localhost/" />
      </audienceUris>
      <federatedAuthentication>
        <wsFederation passiveRedirectEnabled="true" issuer="https://localhost/LoginEndpoint/issue/wsfed" realm="https://localhost/" requireHttps="false" />
        <cookieHandler requireSsl="true" hideFromScript="true" />
      </federatedAuthentication>
      <applicationService>
        <claimTypeRequired>
          <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" />
        </claimTypeRequired>
      </applicationService>
      <issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <trustedIssuers>
          <add thumbprint="XXXXXXXXXXXX" name="https://localhost/LoginEndpoint/" />
        </trustedIssuers>
      </issuerNameRegistry>
      <certificateValidation certificateValidationMode="None" />
      <serviceCertificate>
        <!--Needed for cookie encyption in web-farm environment. -->
        <certificateReference x509FindType="FindByThumbprint" findValue="XXXXXXXXXXXXXXXXX" />
      </serviceCertificate>
    </service>
  </microsoft.identityModel>

...

任何帮助都将不胜感激!即使对于现代SSO解决方案,如果有更好的框架或方法可用于旧的ASP.NET MVC 4客户端,您也可以使用

请注意,这是.NET核心,但原理相同

如果愿意,您仍然可以使用WIF。您只需要更改IDP URL和wtrealm参数

在服务器端,您需要坚如磐石的知识WS-Fed插件

跟着这个

另一种方法是更改为idsrv4开箱即用支持的OpenID Connect


这里有一个好地方。

ADFS让我很困惑。在我的例子中,身份验证与AD无关。如果我在客户端上使用Idsrv4和owin中间件,那么使用WIF的目的是什么?我是否应该删除所有以前与身份验证相关的代码,如SessionAuthenticationModule和WSFederationAuthenticationModule,因为owin将完成它们的工作,对吗?是的,您不需要使用ADFS。这只是一个演示如何配置idsrv4参数的示例。如果您选择OWIN路线,则WS-Fed内置于此。所以不需要WIF。是的,你可以删除这些模块。是的,两者都差不多。如果您想要更新的东西,请使用OpenID Connect。