2010-05-19 60 views
0

在IIS 7.5下的Windows 7 Utilmate,我有被配置成用於驗證如下的應用程序: 匿名&視窗IIS 7.5我做錯了什麼?

在ASP.NET網站,我已經把窗體認證和身份冒充=真 我還否認任何匿名用戶。

<authentication mode="Forms"> 
</authentication> 
<identity impersonate="true"/> 
<authorization> 
<deny user="?"> 
</authorization> 

IIS抱怨。我在做什麼錯... 我想實現的目標:我想讓Windows登錄用戶,這樣我就可以構建一個FormsAuthentication權證並將其傳遞給被動STS。 所以在IIS中我有匿名和窗口...如果只有窗口打勾,我不能進入Login.aspx頁面,因爲我有一個額外的參數從那裏傳遞。 所以現在在webconfig中,我通過說deny user =「?」來禁用匿名用戶。 ,所以它使我與身份驗證的Windows用戶,但使用窗體身份驗證。你知道我的意思?

http://msdn.microsoft.com/en-us/library/ff649264.aspx

如果見表4 IIS集成Windows IIS的Web.config文件,然後設置第三排,相應的WindowsIdentity是DOMIAN \用戶名。它適用於IIS 6.0 WIN2003/XP

下IIS 5.1
+0

當IIS抱怨時,錯誤消息/狀態碼是什麼? – Kev 2010-05-19 11:34:24

+0

我想你可能需要查看asp.net認證文檔。這不是一個微不足道的問題,應該充分理解,而不是從兩段文字中看出來,即使它是正確的。 – 2010-05-19 12:53:49

+0

http://msdn.microsoft.com/en-us/library/ff649264.aspx 如果您看到IIS 4集成Windows IIS ,則Web.config設置第3行,因此WindowsIdentity是Domian \ Username – chugh97 2010-05-20 08:19:04

回答

0

如果這是一個利用基於聲明的身份的應用程序,那麼認證用戶的責任在STS本身,而不是在應用程序中。

如果您配置您的(網絡)應用程序信任外部STS,那麼你的身份驗證模式將是「」,你不得不在配置文件中一整節的「Microsoft.identityModel」 。然後您將在那裏配置STS地址(發行人屬性)。事情是這樣的:

<microsoft.identityModel> 
<service> 
    <audienceUris> 
    <add value="https://aexpense-dev.adatum.com/" /> 
    </audienceUris> 
    <federatedAuthentication> 
    <wsFederation passiveRedirectEnabled="true" issuer="https://localhost/Adatum.SimulatedIssuer/" realm="https://aexpense-dev.adatum.com/" requireHttps="true" /> 
    <cookieHandler requireSsl="false" /> 
    </federatedAuthentication> 
    <serviceCertificate> 
    <certificateReference x509FindType="FindBySubjectDistinguishedName" findValue="CN=localhost"/> 
    </serviceCertificate> 
    <certificateValidation certificateValidationMode="None"/> 
    <applicationService> 
    <claimTypeRequired> 
     <claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" optional="true" /> 
    </claimTypeRequired> 
    </applicationService> 
    <issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> 
    <trustedIssuers> 
     <add thumbprint="f260042d59e14937984c6183fbc6bfc71baf5462" name="https://localhost/Adatum.SimulatedIssuer/" /> 
    </trustedIssuers> 
    </issuerNameRegistry> 
</service> 

的STS本身可能使用窗體身份驗證或別的東西,這取決於實現。