如何为 AWS 部署的 spring 个引导执行器 URL 禁用 CSRF

How to disable CSRF for spring boot Actuator URLs for AWS deployment

我有一个 Spring 启用了 CSRF 的引导应用程序托管在 AWS 上。我已经按照本教程进行操作 enable CSRF for SpringBoot & AngularJS

我已为

禁用 CSRF

"/healthcheck.js", "/health", "/info", "/actuator", "/beans", "/env", "/configprops", "/metrics", "/dump", "/autoconfig", "/mappings", "/trace"

执行器 URL 以及上下文路径和静态文件。

但是,对于 /[contextpath]/healthcheck.js,我仍然得到 401。不确定我是否遗漏了其他任何东西。

感谢任何帮助。

我在将 url 模式添加到 spring security permitAll 后使其工作。

http.authorizeRequests().antMatchers(patterns).permitAll()...