2011-02-01 34 views
0

我希望有人能幫助我。我有一個設置爲通過web配置爲安全Web服務:從匿名網站調用安全的Web服務

<authentication mode="Windows" />  
<authorization> 
    <allow roles="MET\Web-Admin"/>  
    <deny users="*"/> 
    <allow users="MET\JoeUser;MET\JoeSmith"/> 
</authorization> 

而且也是在IIS 7(Windows Server 2008中),它具有以下設置身份驗證:

Anonymous Authentication:Disabled 
ASP.NET Impersonation: Disabled 
Basic Authentication  Disabled 
Forms Authentication: Disabled 
Windows Authentication: Enabled 

匿名網站我在IIS7調用它是:

Anonymous Authentication:Enabled 
ASP.NET Impersonation: Disabled 
Basic Authentication  Disabled 
Forms Authentication: Enabled 
Windows Authentication: Disabled 

在匿名的網站,我通過調用安全的Web服務210

moms.momService myMom = new moms.momService(); 
NetworkCredential netCred = new NetworkCredential(@"username", "password");    
strStatus = myMom.createBackupDirectoryAndPrivs(sData); 

每次我運行這個,它返回爲未授權。我確定此用戶位於Web-Admin AD組中。我也嘗試添加用戶作爲允許用戶但仍然是未經授權的。我很確定問題出在IIS的某個地方,但不知道還有什麼要檢查。

順便說一句:如果我通過我的開發箱上的VS2010開發運行匿名網站,並使用上面的代碼調用安全站點,它可以正常工作。這就是爲什麼我在PROD服務器上思考IIS的原因。

任何幫助,非常感謝。提前致謝。

地理...

回答

0

嘗試移動否認允許設置,因爲他們爲了處理從頂部到底部之後設置:

<allow roles="MET\Web-Admin"/>  
<allow users="MET\JoeUser;MET\JoeSmith"/> 
<deny users="*"/> 
+0

呀,試過了,但仍然訪問被拒絕。 – George 2011-02-01 16:16:52