WSS網站裡Asp.Net 身分識別驗證問題解決

來源:互聯網
上載者:User

由於我們BizTalk項目中經常會需要用到BAS,BAM等,(如:RosettaNet等),所以需要安裝配置WSS,一般預設情況會提升Default Web Site(80)網站, 但是如果有Asp.Net WebSite 需要Host 在預設網站80 裡的時候就會帶來一些身分識別驗證上的困惑,經常會導致身分識別驗證不正常,如

<authentication mode="Windows" />
      <authorization>
        <allow users="mailto:qi.ma@cn.abb.com"/>
        <allow users="asiapacific\cnmaqi1"/>
         <deny users="*"/>
      </authorization>

 --------------------

<location path="TIHandling.asmx">
  <system.web>
   <authorization>
    <allow   users="?"/>   <!--<allow   users="*"/>-->
   </authorization>
  </system.web>
 </location>

或者在使用Asp.Net Login控制項時候也有同樣的問題

<authentication mode="Forms">
            <forms    name=".ASPXAUTH"
                    loginUrl="Login.aspx"
                    protection="All"
                    timeout="30"
                    path="/"
                    requireSSL="false"
                    slidingExpiration="true"
                    defaultUrl="Default.aspx"
                    cookieless="UseDeviceProfile"
                    enableCrossAppRedirects="false"/>
        </authentication>

最初的時候百思不得其解,後來實在不行就索性換了一個網站,但是可以確定是由於WSS造成的, 在Default Web Site(80) 網站根目錄下就會有一個sharepoint 的 web.config,根據msdn官方說法,web.config 有繼承關係,還有一個必須要清楚的是asp.net 身分識別驗證是在httpModules 裡操作的, 查看sharepoint 的web.config,發現了問題,如下:

<httpModules>
            <clear/>
            <add name="OutputCache" type="System.Web.Caching.OutputCacheModule"/>
            <add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule"/>
            <!--    <add name="Session" type="System.Web.SessionState.SessionStateModule"/>-->
        </httpModules>

比對預設的web.config(C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config)

對自己網站下的web.config 做如下調整, 首先清除所有的httpModules,重新添加標準的httpModules:

<system.web>

    ...............
    <httpModules>
            <clear/>
            <add name="OutputCache" type="System.Web.Caching.OutputCacheModule" />
            <add name="Session" type="System.Web.SessionState.SessionStateModule" />
            <add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" />
            <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
            <add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule" />
            <add name="RoleManager" type="System.Web.Security.RoleManagerModule" />
            <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" />
            <add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule" />
            <add name="AnonymousIdentification" type="System.Web.Security.AnonymousIdentificationModule" />
            <add name="Profile" type="System.Web.Profile.ProfileModule" />
            <add name="ErrorHandlerModule" type="System.Web.Mobile.ErrorHandlerModule, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        </httpModules>

.................

至此Login控制項等身分識別驗證工作正常.

 

Tips:“*”表示所有使用者;“?”表示匿名使用者;

相關關鍵詞:
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.