<security:intercept-url pattern="/person/**"
access="isAuthenticated()" />
<security:intercept-url pattern="/person?reg"
access="isAnonymous()" />
I want for filter to intercept all of the requests that are /person/blabla etc.
But there should be a single one available to anonymous users to register themself.
Whenever I introduce the first rule all sub requests are protected including the bottom one which is not what is required.
If I don’t introduce first then the bottom request is allowed, but also all subsequent requests such as /person/myProfile can be accessed by anonymous user.
From the Spring Security docs:
Also, spring uses ant-style pattern matching by default, which doesn’t include the parameters when trying to make a match. You’re wanting to also match on whether or not a parameter exists. In order to do that, you’re going to need to set regex matching via the
request-matcherattribute onhttp.