【问题标题】:How to return http status 403 on http connection, not on https using Spring如何在 http 连接上返回 http 状态 403,而不是在 https 上使用 Spring
【发布时间】:2011-02-16 18:42:56
【问题描述】:

我正在使用 spring mvc 和 spring security 来锁定 Web 服务。我已使用此限制所有连接使用 https ...

<http auto-config='true'>
    <intercept-url pattern="/**" access="ROLE_USER" requires-channel="https"/>
    <http-basic/>
</http>

但是当我通过 http 连接时,我没有收到 http 状态代码 403 Forbidden。

【问题讨论】:

    标签: spring-mvc spring-security


    【解决方案1】:

    我猜你需要拦截SecureChannelProcessor 的创建(例如,使用BeanPostProcessor)并为其提供自定义ChannelEntryPoint 将发送“403 Forbidden”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-06
      • 1970-01-01
      • 1970-01-01
      • 2020-09-11
      • 2021-09-19
      • 2016-09-23
      • 2015-10-23
      • 2016-01-29
      相关资源
      最近更新 更多