pie*_*ier 3 security spring-boot spring-boot-actuator
我使用Spring启动(1.3.0)与泽西岛(POM依赖关系:spring-boot-starter-jersey,spring-boot-starter-actuator,spring-boot-starter-web,spring-boot-starter-security).
我有一个Jersey端点(见下文),这非常简单:
@Component
@Path("/helloworld")
public class HelloWorldResource {
@GET
public String home() {
return "Hello World !";
}
}
Run Code Online (Sandbox Code Playgroud)
我通过为Spring MVC url(server.servlet-path=/system)设置特定路径来启用Spring Boot Actuator ,如Spring Boot指南中所述.
由于spring-boot-starter-security,Actuator端点通过基本身份验证得到保护.
我的问题是,这/helloworld也是安全的,但我想让它不安全.
我怎样才能做到这一点 ?
谢谢 !
您必须在yaml/properties文件中配置设置,如下所示 -
server:
port: 8080
context-path: /MyApplication
security:
user:
name: admin
password: secret
basic:
enabled: false
management:
context-path: /actuator
security:
enabled: true
Run Code Online (Sandbox Code Playgroud)
因此,对于您的应用程序,安全性已禁用,但已为执行器端点启用.确保您没有在管理安全性下配置用户名/密码,否则它将无法正常工作.
| 归档时间: |
|
| 查看次数: |
3882 次 |
| 最近记录: |