Windows Identity Foundation(WIF)应用程序+经典pipe道模式下的ADFS 2.0 – 是否有可能?

我有一个工作testing应用程序,它使用Windows Idendity Foundation SDK和ADFS 2.0进行身份validation,该应用程序在Windows Server 2008 R2,IIS 7.5,集成托pipepipe道应用程序池模式下运行。

我的问题是,我需要使用这种身份validation设置的“真正的”应用程序只能在传统代码pipe理stream水线应用程序池模式下运行,当我select它时,我收到一个“HttpException(0x80004005):失败执行URL“错误。

有没有人有一个想法如何解决这个问题?

更新:我发现https://example.com/myapplicatio/给我的错误,但https://example.com/myapplicatio/Default.aspx的作品。

我有同样的问题。 这里是另外一个在其他地方的讨论,类似 你是否解决了你的问题?

http://social.msdn.microsoft.com/Forums/en/Geneva/thread/43392dc5-e764-4027-8de5-1638a4c17540

底下的保罗的评论是有用的。

我能find一个解决我的应用程序失败的原因这个错误。

在我的虚拟环境中,我尝试使用SharePointClaimsMembershipProvider使用ADFS 2.0服务器来获取MOSS 2007 Extranet实例进行身份validation。

我从其他一些答案中得到的暗示是,索赔身份没有被正确填充,特别是当使用匿名访问时。 有些人提供了一些代码来处理匿名访问情况。

在我的情况下,我是身份validation,但仍然得到这个错误。 所以,基本上,问题是ADFS2.0不提供我的应用程序configuration的声明标识types。

你可以在web.config文件中看到你想要为你的应用程序获得哪些声明。

<microsoft.identityModel> <service> <audienceUris> <add value="https://moss2007hv.kor.cmil.mil/" /> </audienceUris> <applicationService> <claimTypeRequired> <!--Following are the claims offered by STS 'http://adfs.kor.cmil.mil/adfs/services/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/givenname" 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/surname" 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/nameidentifier" optional="true" />--> <!--<claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationinstant" optional="true" />--> <!--<claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod" optional="true" />--> <!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/denyonlysid" optional="true" />--> <!--<claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarysid" optional="true" />--> <!--<claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarygroupsid" optional="true" />--> <!--<claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid" optional="true" />--> <!--<claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/primarygroupsid" optional="true" />--> <!--<claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid" optional="true" />--> <!--<claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname" optional="true" />--> </claimTypeRequired> </applicationService> <!--Commented out by Federation Utility for SharePoint 3.0--> <!--<serviceCertificate><certificateReference x509FindType="FindByThumbprint" findValue="DAC77B6076433468D5E1030F8B66126BF261F2BB" storeLocation="LocalMachine" storeName="My" /></serviceCertificate>--> <federatedAuthentication> <wsFederation passiveRedirectEnabled="true" issuer="https://adfs.kor.cmil.mil/adfs/ls/" realm="https://moss2007hv.kor.cmil.mil/" requireHttps="true" /> <cookieHandler requireSsl="true" /> </federatedAuthentication> <serviceCertificate> <certificateReference x509FindType="FindByThumbprint" findValue="DAC77B6076433468D5E1030F8B66126BF261F2BB" storeLocation="LocalMachine" storeName="My" /> </serviceCertificate> <issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <trustedIssuers> <add thumbprint="FC144B44D2D81BCA7CFB933A8D818236C94E8505" name="http://adfs.kor.cmil.mil/adfs/services/trust" /> </trustedIssuers> </issuerNameRegistry> </service> </microsoft.identityModel> 

在上面的示例中,名称和angular色声明是预期的。

于是,我回到了我的ADFS服务器,并validation了我已经正确创build了依赖方信任。

接下来,您右键单击依赖方信任和编辑声明规则。 右键单击现有规则或添加规则(如果不存在)。 对于这个例子,我注意到我没有设置传出声明types的名称。 所以,我使用LDAP属性:用户原则名称,并将其映射到传出声明types名称。

对于angular色,我使用了Token-Groups-Unqualified Names并将其映射到angular色。

一旦我正确地在我的ADFS服务器上configuration规则,以提供在我的web.config中请求的声明,错误消失,事情工作,如预期。