开发者

URL-based authorization and ajaxpro problem

I have an ASP.NET app using Ajaxpro and forms authentication. First I 开发者_开发百科was having trouble trying to avoid passing the ajaxpro handlers through authorization, which was resolved when I included them on separate locations on the web.config:

<location path="ajaxpro/prototype.ashx">
    <system.web>
            <authorization>
                    <allow users="*"/>
            </authorization>
    </system.web>
</location>
<location path="ajaxpro/core.ashx">
    <system.web>
            <authorization>
                    <allow users="*"/>
            </authorization>
    </system.web>
</location>
<location path="ajaxpro/converter.ashx">
    <system.web>
            <authorization>
                    <allow users="*"/>
            </authorization>
    </system.web>
</location>

However, I'm still getting 401 errors when I try to access our AjaxMethods. I event tried to put our types under the following configuration:

<location path="ajaxpro/MyType,MyAssembly.ashx">
    <system.web>
        <authorization>
            <allow  users="*"/>
        </authorization>
    </system.web>
</location>

but that didn't work properly, and I'm still getting 401 responses in some particular cases: I realized that when my requests have some query string values, this setting isn't working.

I wish I could do something like path="ajaxpro/*", but it seems like that is not possible. Does anyone have other ideas?


You should be able to specify the location with folder name only like this:

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜