Trying to switch the security off for one URL with XML configuration

后端 未结 2 1519
终归单人心
终归单人心 2021-01-24 04:08

I checked several blogs / doc / stackoverflow forum entries but I still don\'t know what I am doing wrong.
I want to give access to an URL to anybody. The perm

相关标签:
2条回答
  • 2021-01-24 04:42

    It s a bug/missing feature in Spring Boot/Spring Security, see

    • Security filters in xml are automatically registered out of the FilterChainProxy
    • SEC-2723: Add meta-data to bean definitions of Spring Security Filter beans identifying them as "inner"

    Some work-arounds are possible, one is to use Java configuration instead of XML configuration.

    0 讨论(0)
  • 2021-01-24 04:51
    <security:intercept-url pattern="/**" access="denyAll" /> 
    

    will not allow access to any resource irrespective of what ever sub pattern you define for other resources.

    Change your pattern to somthing like

    <security:intercept-url pattern="/secure/**" access="denyAll" /> /*add an extra folder and shift the resources there */ 
    

    and

    <security:intercept-url pattern="/**" access="permitAll()" />
    
    0 讨论(0)
提交回复
热议问题