![](/img/trans.png)
[英]How to add channel security as https in spring security using “annotations”?
[英]Spring security: forcing https using annotations?
春季安全文檔聲明(2.3.2):
如果您的應用程序同時支持HTTP和HTTPS,並且您要求只能通過HTTPS訪問特定URL,則可以使用requires-channel屬性直接支持:
<http>
<intercept-url pattern="/secure/**" access="ROLE_USER" requires-channel="https"/>
<intercept-url pattern="/**" access="ROLE_USER" requires-channel="any"/>
...
</http>
但是我在我的控制器上使用注釋,而不是攔截元素。
從可用的文檔中可以看出, 僅使用注釋可能無法強制實施通道安全性。
有許多示例顯示如何在Spring Security中使用注釋
http://www.jroller.com/habuma/entry/method_level_security_in_spring
我不明白你為非安全頁面強制HTTP是什么意思。 如果它是不安全的,那么它已經是HTTP。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.