SpringBoot
文章平均质量分 75
狮子大大
这个作者很懒,什么都没留下…
展开
-
SpringBoot OAuth2.0 使用 Redis 保存短信验证码 + AccessToken
SpringBoot OAuth2.0 使用 Redis 保存短信验证码 + AccessToken上一篇: SpringBoot OAuth2.0 使用短信验证码登录授权使用 Redis 缓存服务,将授权服务返回的短信验证码和 access_token 保存到 redis 中。添加 redis 依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>原创 2021-03-26 18:04:44 · 401 阅读 · 2 评论 -
SpringBoot OAuth2.0 使用短信验证码登录授权
SpringBoot OAuth2.0 使用短信验证码登录授权实现步骤:自定义授权器,继承 AbstractTokenGranter 类;重写 getOAuth2Authentication 函数,在这个函数中,自定义授权认证逻辑;校验手机号 + 短信验证码是否一致getOAuth2Authentication, 手机和验证码校验无误, 返回 OAuth2Authentication 授权信息(access_token)创建 SmsCodeTokenGranter 继承 AbstractTo原创 2021-03-26 18:04:05 · 1500 阅读 · 0 评论 -
SpringBoot OAuth2.0 refresh_token(刷新令牌)
SpringBoot OAuth2.0 刷新令牌通常在 access_token 时间过期后,需要去获取新的 token 才能继续访问接口在 使用 SpringSecurity + OAuth2.0, 可以采用 refresh_token 模式重新申请 access_token修改 MooseAuthorizationServerConfiguration 文件 /** * Authorization Server endpoints. * * @throws Exception原创 2021-03-26 17:59:38 · 3959 阅读 · 0 评论 -
SpringBoot OAuth2.0 认证授权(密码模式)
SpringBoot OAuth2.0 认证授权(密码模式)SpringBoot 整合 SpringSecurity,token 落地,前后端分离接口安全。SpringBoot 环境搭建和入门:Spring Boot 2.x 快速入门导入 mysql 脚本包含用户表,oauth2.0 数据脚本https://gitee.com/shizidada/moose-resource/blob/master/moose-security.sql全部 : https://gitee.com/shizid原创 2021-03-26 17:58:17 · 1449 阅读 · 0 评论 -
SpringBoot 2.x 系列 - 快速入门
使用 Idea 创建 Maven 项目,添加 Spring Boot 依赖<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 ht原创 2021-03-26 17:54:34 · 128 阅读 · 0 评论