springboot security dependency的user和password

当创建springboot maven项目时,若引用了如下依赖,

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-security -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-security</artifactId>
    <version>2.0.2.RELEASE</version>
</dependency>

项目启动时,会要求输入user和password,springboot默认的user是:user,password会在启动时,输出在console里了

既然开始了,不妨深入了解下
SpringSecurity核心功能:

  • 认证(你是谁)
  • 授权(你能干什么)
  • 攻击防护(防止伪造身份)

若在开发期间不想使用security,可以在配置文件中加入下面代码:

# security 使能
security.basic.enabled = false

猜你喜欢

转载自blog.csdn.net/hacker_Lees/article/details/82841815