当前位置:网站首页>Detailed explanation of redis's single login
Detailed explanation of redis's single login
2022-07-26 12:46:00 【User 9919783】
Environmental requirements :redis3.8.2+maven+springBoot+jdk1.8+freemarker Templates
1、 Demand background
At home on weekends , Last colleague suddenly contacted , Let me do a single sign on function for his website , So I sort out the logic first , Realize the function and record .
Single sign in (Single sign on) seeing the name of a thing one thinks of its function , After a website logs in , Other websites do not need users to continue to enter account passwords , And can login without secret , This technology is used very frequently in large websites , For example, Alibaba , When users log in to their system , Each subsystem can log in automatically , If you log in to a treasure , Log in to a monument , You also need a password , You also need to re-enter your password to log in to Taobao , This will definitely result in a very poor user experience , And the authentication logic of the system will also be troublesome , At this time, single sign on appears .
2、 Code instance
This article demonstrates two systems
1、 Ensure that when accessing the login page of the system , Enter the first homepage of the system , When visiting the login page of system 2 , Enter the homepage of system 2 .
2、 When accessing system one or system two , We need to judge redis Whether there is a current user in , If it exists, login without secret .
3、 Logical processing , Before logging in, first judge whether the account and password in the database are correct , If the user logs in correctly on the page , Then it returns login success , And put in redis, Set an expiration time for him .
4、 Guaranteed at redis Other subsystems can log in without secret within the expiration time .
边栏推荐
- Emerging security providers to learn about in 2022
- 14.2字节流学习
- Implementation of dynamic and static libraries (packaging dynamic and static libraries for others to use)
- How do children's playgrounds operate?
- Transactional transaction propagation behavior?
- 10. 509. Introduction to PKCs file format
- Map函数统计字符出现的次数
- 微软关闭了两种攻击途径:Office 宏、RDP 暴力破解
- Sim900a based on STM32 sends short messages in Chinese and English
- Azure Synapse Analytics 性能优化指南(2)——使用具体化视图优化性能(上)
猜你喜欢

Implementation of dynamic and static libraries (packaging dynamic and static libraries for others to use)

今日睡眠质量记录75分

Food safety | is self-made food purchased online healthy food? Don't fall into these misunderstandings

Removable tablespace

How much do you know about the two infrastructures of the badminton stadium?

食品安全 | 微波炉什么食品都能加热?这些安全隐患要知道

How to view encrypted information in text form

How do children's playgrounds operate?

微软关闭了两种攻击途径:Office 宏、RDP 暴力破解

Problems encountered in byte stream exercises and Solutions
随机推荐
腾讯云与智慧产业事业群(CSIG)调整组织架构,成立数字孪生产品部
Backtracking - question 51 Queen n -- a classic backtracking problem that must be overcome
可移动表空间
Access数据库无法连接
今日睡眠质量记录75分
结合环境光、接近传感以及红外测距的光距感芯片4530A
Jsj-3/ac220v time relay
Emerging security providers to learn about in 2022
PXE原理与配置
STM32驱动HC05蓝牙串口通信模块
Access database cannot connect
yolov7训练危险品识别 pytorch
HCIP-9.OSPF的各种拓展
Backtracking - 491. Incremental subsequence
数据库组成存储过程和函数
敲黑板画重点:七种常见“分布式事务”详解
Who is responsible for the problems of virtual idol endorsement products? And listen to the lawyer's analysis
回溯——第51题. N皇后——必须攻克的经典回溯难题
LCD笔记(5)LCD驱动程序框架_使用设备树
Customize browser default right-click menu bar