美文网首页
Spring Security实践

Spring Security实践

作者: Superwind20 | 来源:发表于2017-08-23 22:01 被阅读71次

Spring Security提供Basic Auth的鉴权方式,在一些涉及敏感信息的场景,例如应用监控等,可引入使用。

1. 配置依赖

org.springframework.boot

spring-boot-starter-security

2. properties或yml文件配置相关参数

#开关

management:

security:

enabled: true

#安全相关配置

security:

user:

name: user

password: password

basic:

path: /configprops

basic:

enabled: false

上述配置表示: 基础控制的url为 /configprops,可以配置多个,基础控制开关为关闭,即不做任何控制。

相关文章

网友评论

      本文标题:Spring Security实践

      本文链接:https://www.haomeiwen.com/subject/ldwjdxtx.html