动力节点Springsecurity笔记01-05认证入门

本文是Spring Security认证入门的学习笔记,详细介绍了如何保护Spring Boot程序,涵盖认证授权基本概念、不使用安全框架的Spring Boot程序、基于配置文件的用户管理以及内存中的多用户管理。通过实例演示了Spring Security的使用,包括添加依赖、配置用户和密码、登录退出流程,以及遇到的密码加密和权限控制问题。
摘要由CSDN通过智能技术生成

1 问题 如何保护我们的程序?

1.1 创建code目录

目的:后面的security工程均在此目录下学习
创建code目录,并使用idea打开

1.2 不使用安全框架的springboot web程序

1.2.1 新建子模块springboot-01-hello

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-uAeASGKn-1681958373972)(https://cdn.nlark.com/yuque/0/2023/png/32441366/1681955131092-bbc460d1-dc01-4b6a-bdf3-38a7a06ee7be.png#height=303&width=415)]

1.2.2 添加依赖和maven插件等

pom.xml 中部分内容如下,此处使用bootpom模板创建并粘贴

<parent>
    <artifactId>spring-boot-starter-parent</artifactId>
    <groupId>org.springframework.boot</groupId>
    <version>2.6.13</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <maven.compiler.source>8</maven.compiler.source>
    <maven.compiler.target>8</maven.compiler.target>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <!--springboot web 程序 -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <!--springboot 单元测试-->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test<
  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值