0

これが私の問題です...

II7 統合パイプライン モードで実行されている Web サイトがあり、ログイン フォームを含む '/secure/' ディレクトリ以外の Web サイト全体でフォーム認証を有効にしたいと考えています。

私のWeb設定は現在、次のようになっています...

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.web>
        <customErrors mode="Off"/>
        <authentication mode="Forms">
            <forms name=".ASPXAUTH" loginUrl="secure/login.aspx" protection="All" path="/" timeout="999999" slidingExpiration="true" enableCrossAppRedirects="true">
                <credentials passwordFormat="Clear">
                    <user name="user1" password="xxxxxx"/>
                </credentials>
            </forms>
        </authentication>
        <authorization>
            <allow users="user1"/>
            <deny users="*"/>
        </authorization>    
    </system.web>
    <location path="secure">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>
    <system.webServer>
        <!--Enabling Forms Authentication for the Entire Application-->
        <modules> 
            <remove name="FormsAuthenticationModule" />    
            <add name="FormsAuthenticationModule" type="System.Web.Security.FormsAuthenticationModule" />    
            <remove name="UrlAuthorization" />    
            <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" />    
            <remove name="DefaultAuthentication" />    
            <add name="DefaultAuthentication" type="System.Web.Security.DefaultAuthenticationModule" />    
        </modules>
    </system.webServer>
</configuration>

Web サイトの URL にアクセスすると、リダイレクトの無限ループが発生します。system.web セクションの上に場所固有の認証ルールを配置しようとしましたが、これは効果がありませんでした。

何か案は?

乾杯、

ロビン

4

1 に答える 1

3

アクセス許可は階層的です。つまり、ある親へのアクセスが禁止されている場合、子にどのような権限が設定されていても、そのすべての子へのアクセスが禁止されます。ログイン フォームをルート ディレクトリに移動し、フォームのアクセス許可を設定することができます。これは機能します。

于 2012-04-10T10:46:53.877 に答える