当前位置:网站首页>Do you really understand the principle of code scanning login?
Do you really understand the principle of code scanning login?
2022-04-23 16:40:00 【Always--Learning】
Why should we understand the principle of scanning code login ?
Login by scanning QR code has become a common login method , This method can quickly log in without entering user name and password , It involves PC End 、 Interaction between mobile terminal and server terminal , Whether for front-end developers or back-end developers , Mastering the principle of code scanning login can help us design a set of login mechanism to serve our own applications .
The main stage of code scanning login
Stage 1: To be scanned
The phase to be scanned is PC The process of interaction between client and server , It mainly includes the following steps :
- PC The terminal carries its own device information , Send a request to the server to obtain QR code information .
- The server generates a unique QR code ID, And bind with this device .
- Service end-to-end PC End return QR code ID.
- PC According to the QR code ID Display QR code for mobile terminal scanning .
- PC Start a timer , Regularly poll the server , Query the status of QR code , Is it scanned , If it hasn't been scanned for a while , The QR code will fail .
Stage 2: Scanned for confirmation
This stage is mainly the interaction process between the mobile terminal and the server , It mainly includes the following steps :
- Scan QR code at mobile terminal , Get QR code ID.
- The mobile terminal will its own identity information token, And send the scanned QR code information to the server .
- The server sends the QR code ID Bind with identity information , Generate temporary token.
- The server will temporarily token Back to the mobile . This temporary token Can be used as a credential to confirm login .
- PC The terminal will poll the status of the QR code , Update the status of QR code to be confirmed .
Stage 3: Confirmed phase
The confirmed stage mainly includes the following steps :
- The mobile terminal carries temporary equipment token, Confirm login .
- The server receives a temporary message token after , After verification , The status of QR code will be changed to confirmed , Then generate PC End token.
- PC The terminal will poll the status of the QR code , And change to confirmed .
- Service end-to-end PC The terminal sends QR code status and PC End token.
- PC End by virtue PC End token Access server API.
Overall flow chart
版权声明
本文为[Always--Learning]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231640198079.html
边栏推荐
- You need to know about cloud disaster recovery
- Sail soft calls the method of dynamic parameter transfer and sets parameters in the title
- Project framework of robot framework
- New project of OMNeT learning
- MySQL master-slave synchronization pit avoidance version tutorial
- 5分钟NLP:Text-To-Text Transfer Transformer (T5)统一的文本到文本任务模型
- 无线鹅颈麦主播麦手持麦无线麦克风方案应当如何选择
- VIM uses vundle to install the code completion plug-in (youcompleteme)
- Zhongang Mining: Fluorite Flotation Process
- JMeter installation tutorial and solutions to the problems I encountered
猜你喜欢
Deepinv20 installation MariaDB
Xinwangda: HEV and Bev super fast charging fist products are shipped on a large scale
Easyexcel reads the geographical location data in the excel table and sorts them according to Chinese pinyin
Gartner announces emerging technology research: insight into the meta universe
JMeter setting environment variable supports direct startup by entering JMeter in any terminal directory
Kunteng full duplex digital wireless transceiver chip kt1605 / kt1606 / kt1607 / kt1608 is suitable for interphone scheme
昆腾全双工数字无线收发芯片KT1605/KT1606/KT1607/KT1608适用对讲机方案
File upload and download of robot framework
Zhongang Mining: Fluorite Flotation Process
Oak-d raspberry pie cloud project [with detailed code]
随机推荐
关于 background-image 渐变gradient()那些事!
Deepinv20 installation MariaDB
Introduction notes to PHP zero Foundation (13): array related functions
MySQL master-slave replication
Server log analysis tool (identify, extract, merge, and count exception information)
Hypermotion cloud migration completes Alibaba cloud proprietary cloud product ecological integration certification
LVM与磁盘配额
Zhongang Mining: Fluorite Flotation Process
MySql主从复制
LVM and disk quota
05 Lua 控制结构
The first line and the last two lines are frozen when paging
Redis "8" implements distributed current limiting and delay queues
How to upgrade openstack across versions
Cartoon: what are IAAs, PAAS, SaaS?
1959年高考数学真题
Disk management and file system
Gartner 發布新興技術研究:深入洞悉元宇宙
无线鹅颈麦主播麦手持麦无线麦克风方案应当如何选择
力扣-746.使用最小花费爬楼梯