Spring Security安全访问控制解决方案的安全框架

Spring Security是一个能够为基于Spring的企业应用系统提供声明式的安全访问控制解决方案的安全框架。它提供了一组可以在Spring应用上下文中配置的Bean,充分利用了Spring IoCDI(控制反转Inversion of Control ,DI:Dependency Injection 依赖注入)和AOP(面向切面编程)功能,为应用系统提供声明式的安全访问控制功能,减少了为企业系统安全控制编写大量重复代码的工作。

学习导图

单词汇总

Authorization :授权

Authentication :认证(登录)

WebSecurityConfigurerAdapter  web安全配置类(认证授权配置)

@EnableWebSecurity :开启web安全配置

HttpSecurity  http安全配置

permitAll  放行

antMatchers  用来匹配某些url路径

UserDetailsService :用户详情服务(用来加载数据库的用户数据) UserDao

SecurityContext : Security上下文工具,保存得有认证成功之后的用户信息

这是Spring Security导包

<dependency>

      <groupId>org.springframework.boot</groupId>

      <artifactId>spring-boot-starter-security</artifactId>

    </dependency>

原文地址:https://www.cnblogs.com/china10/p/14638427.html