Skip to content

Utomcat/studyspringsecurity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started

Reference Documentation

For further reference, please consider the following sections:

Guides

The following guides illustrate how to use some features concretely:

一、Spring Security的学习

1)、环境在Spring Boot 2.2.6.RELEASESpring Security 2.2.6.RELEASE的时候无论配置没配置对应的安全拦截类,都会有默认的安全验证和访问控制,即需要先登录在进入web

解决方案:

  1. Spring Boot的配置文件中添加Spring Security的用户信息。在进入web时使用此账户进行登录
  2. 在启动类处禁用spring Security的安全设置,禁用设置如下:
 package com.yq;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 
 @SpringBootApplication(scanBasePackages = {"com.yq"})
 @EnableAutoConfiguration(exclude = {
 org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
 })
 public class WebSecurityDemoApp {
     private static final Logger log = LoggerFactory.getLogger(WebSecurityDemoApp.class);
 
     public static void main(String[] args) {
         SpringApplication.run(WebSecurityDemoApp.class, args);
     }
 
 }

2)、在Spring Boot 2.2.6.RELEASE版本不支持thymeleafSpring Security的整合

最高支持 Spring Boot 2.0.9.RELEASE版本

About

关于Spring Security的学习

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors