Java 是不是;“正常”;在Spring Security的AuthenticationFilter中需要'ConfigurationAttribute'吗?

Java 是不是;“正常”;在Spring Security的AuthenticationFilter中需要'ConfigurationAttribute'吗?,java,spring,spring-security,Java,Spring,Spring Security,或者它确定了一个设计问题 要决定是否应在我的自定义AuthenticationFilter中继续筛选链,我需要检查Authentication是否为匿名身份验证令牌,以及当前匹配的URL是否具有access=“permitAll”属性(这通常由过滤器安全interceptor处理) 所以 换句话说,我需要一种方法来识别URL路径,在该路径上我应该跳过身份验证,但仍然有一个匿名令牌,以便安全拦截器像往常一样工作 我使用的是Spring Security 3.0.1,因此目前不允许为不同的URL

或者它确定了一个设计问题

要决定是否应在我的自定义
AuthenticationFilter
中继续筛选链,我需要检查
Authentication
是否为
匿名身份验证令牌
,以及当前匹配的URL是否具有
access=“permitAll”
属性(这通常由
过滤器安全interceptor
处理)

所以


换句话说,我需要一种方法来识别URL路径,在该路径上我应该跳过身份验证,但仍然有一个匿名令牌,以便安全拦截器像往常一样工作


我使用的是Spring Security 3.0.1,因此目前不允许为不同的URL路径使用单独的筛选链。

您将身份验证和授权混合在一起,因此这肯定是一种气味。访问
有什么问题吗?=“is\u AUTHENTICATED\u匿名”

您将身份验证和授权混为一谈,因此这肯定是一种气味。访问
有什么问题吗?

<!-- chain should continue past authentication regardless of authentication type (anonymous/actual) -->
<security:intercept-url pattern="/pages/public/public.html" access="permitAll"/>

<!-- chain should continue only on non-anonymous authentication -->
<security:intercept-url pattern="/pages/authenticated/stuff.html" access="isAuthenticated()"/>