Spring Security 3:intercept-url属性“method”第一次运行正常

时间:2010-04-21 09:02:24

标签: spring-security http-basic-authentication

我是Spring Security 3的新手,我遇到了下一个问题。 使用spring-security命名空间,我尝试配置单个基本身份验证,我只想过滤POST方法。

从我的servlet.xml配置:

<security:http  auto-config='true'>
    <security:http-basic></security:http-basic>
    <security:intercept-url method="POST" pattern="/**" access="ROLE_USER" />
</security:http>

嗯,问题是,在启动服务器之后,它第一次正常工作(也就是说,其他方法不会提示任何身份验证屏幕)。但是在第一次使用POST方法后,它会提示所有方法的身份验证屏幕。有谁知道我错过了什么?

提前感谢您的时间! ; - )

1 个答案:

答案 0 :(得分:0)

好的,自动回答!的xD 我正在尝试使用一个名为Rest Client的Firefox插件(我真的推荐它;-))。在第一次使用POST方法登录后,我的失败是它保存在缓存中,它提示了HTTP-BASIC身份验证。清理完我的历史后,它运作正常。

之后,我学到了:

- 使用浏览器时始终在缓存中

- 在Stackoverflow xD中询问有关环境的更多信息

谢谢大家!!