开发者

protecting route to classic asp files in mvc

I have to run a classic asp project in the root folder of a mvc folder.

How can i set up the web config to protect the routes through classic asp files?

I tried the following but now i'm not having access to anything....

<location path="Account">
    <system.web>
        <authorization>
            <allow users="*" />
        </authorization>
    </system.web>
</location>

<location path="/">
    <system.web>
        <authorization>
       开发者_开发知识库     <deny users="?" />
        </authorization>
    </system.web>
</location>

The Controller will get a [Authorize(Users = "*")] to protect them from anonymous users.

Regards float


I found a solution for my Problem. I had to add following lines to the web.config:

<configuration>
<system.web>
    <authorization>
        <deny users="?" />
    </authorization>
</system.web>
<!-- allow specific mvc files/folders -->
<location path="Content">
    <system.web>
        <authorization>
            <allow users="*" />
        </authorization>
    </system.web>
</location>

<location path="Home">
    <system.web>
        <authorization>
            <allow users="*" />
        </authorization>
    </system.web>
</location>

<!-- allow specific asp files/folders -->
<location path="logout.asp">
    <system.web>
        <authorization>
            <allow users="*" />
        </authorization>
    </system.web>
</location>
</configuration>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜