• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Y-wee
博客园    首页    新随笔    联系   管理     

随笔分类 -  安全框架

springsecurity整合springboot实现记住我自动登录

摘要:springsecurity整合springboot实现记住我自动登录 springsecurity实现记住我自动登录原理:用户登录时将token通过cookie保存在浏览器同时插入数据库,下一次登录时会从浏览器获取token查询数据进行匹配,匹配成功则自动登录 编写配置类继承WebSecurity 阅读全文
posted @ 2022-03-05 21:57 Y-wee 阅读(243) 评论(0) 推荐(0)
springsecurity整合springboot实现自定义登录页面及访问路径权限配置

摘要:springsecurity整合springboot实现自定义登录页面及访问路径权限配置 编写配置类继承WebSecurityConfigurerAdapter,重写void configure(HttpSecurity http)方法 package com.yl.config; import c 阅读全文
posted @ 2022-03-04 23:01 Y-wee 阅读(2036) 评论(0) 推荐(0)
springsecurity整合springboot实现自定义用户名和密码

摘要:springsecurity整合springboot实现自定义用户名和密码 通过配置文件实现 在application.yml中设置用户名和密码 spring: security: user: name: admin password: admin 通过配置类实现 package com.yl.co 阅读全文
posted @ 2022-02-28 21:50 Y-wee 阅读(918) 评论(0) 推荐(0)
spring security异常处理的三种方式

摘要:spring security异常处理的三种方式 1、在spring security配置文件中处理 注意,这种方式只能处理403权限不足异常 <!--设置可以用spring的el表达式配置Spring Security并自动生成对应配置组件(过滤器)--> <security:http auto- 阅读全文
posted @ 2021-02-24 15:11 Y-wee 阅读(826) 评论(0) 推荐(0)
spring security权限控制

摘要:spring security权限控制 SpringSecurity可以通过注解的方式来控制类或者方法的访问权限。注解需要开启对应的注解支持,若注解放在controller类中,对应注解支持应该放在mvc配置文件中,因为controller类是有mvc配置文件扫描并创建的,同理,注解放在servic 阅读全文
posted @ 2021-02-24 15:10 Y-wee 阅读(381) 评论(0) 推荐(0)
spring security实现记住我功能

摘要:spring security实现记住我功能 1、单选框name设置为remember-me,value设置为true、1、on、yes其中一个都可以 2、开启remember me过滤器 <!--开启remember me过滤器,设置token存储时间为60秒--> <security:remem 阅读全文
posted @ 2021-02-24 15:09 Y-wee 阅读(160) 评论(0) 推荐(0)
springsecurity入门案例

摘要:springsecurity入门案例 1、导包 <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId> <version>5.1.5.RE 阅读全文
posted @ 2021-02-24 15:07 Y-wee 阅读(153) 评论(0) 推荐(0)
ssm整合shiro实现认证授权

摘要:ssm整合shiro实现认证授权 1、导包 <!--加载shiro的库--> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-all</artifactId> <version>1.3.2</version> </ 阅读全文
posted @ 2020-11-16 19:25 Y-wee 阅读(190) 评论(0) 推荐(0)
shiro-jdbc-realm.ini文件

摘要:shiro-jdbc-realm文件 shiro默认的配置项 #默认的securitymanager securitymanager=org.apache.shiro.mgt.defaultsecuritymanager #默认认证器 authenticator=org.apache.shiro.a 阅读全文
posted @ 2020-11-15 11:17 Y-wee 阅读(113) 评论(0) 推荐(0)
shiro凭证配置

摘要:shiro凭证配置 1、方式一 在自定义realm的构造器中配置凭证匹配器对象 public UserRealm() { //凭证匹配器对象 HashedCredentialsMatcher matcher=new HashedCredentialsMatcher(); //指定加密算法 match 阅读全文
posted @ 2020-11-08 11:26 Y-wee 阅读(217) 评论(0) 推荐(0)
shiro自定义Realm实现认证和授权案例

摘要:shiro自定义Realm实现认证和授权案例 1、创建实体类 package com.yl.bean; import java.io.Serializable; /** * 用户实体类 */ public class User implements Serializable { private In 阅读全文
posted @ 2020-11-06 21:32 Y-wee 阅读(161) 评论(0) 推荐(0)
shiro基于ini文件入门案例

摘要:shiro基于ini文件入门案例 1、导包 如果测试类不在测试环境下,则改变依赖作用范围为compile <dependencies> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-core</artifactI 阅读全文
posted @ 2020-11-06 17:11 Y-wee 阅读(141) 评论(0) 推荐(0)

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3