3

I am trying to use Spring Security v3.2 for a project. At the moment I always use a coldfusion file that calls other files to build up the view. So all my urls go trough index.cfm?blablah.

Now I am stuck with allowing the anonymous user enter the home view. Following Spring Security request matcher is not working with regex, I made up the this code:

<http use-expressions="true">
    <intercept-url pattern="^.*index.cfm\?action=home.*$" access="permitAll" />
    <intercept-url pattern="/root/index.cfm" access="isAuthenticated()" />
    <intercept-url pattern="/**" access="isAuthenticated()" />
    <form-login />
</http>

But whatever I try, I always enter the login field.

4

1 回答 1

8

After more trying I found a solution:

<http request-matcher="regex" pattern="^.*index.cfm\?action=home.*$" security="none"/>

<http use-expressions="true">
    <intercept-url pattern="/root/index.cfm" access="isAuthenticated()" />
    <intercept-url pattern="/root/**" access="permitAll" />
    <intercept-url pattern="/**" access="isAuthenticated()" />
    <form-login />
 </http>
于 2013-05-22T08:30:45.310 回答