当前位置:网站首页>重新理解oauth2.0协议进行联合登录
重新理解oauth2.0协议进行联合登录
2022-06-30 11:06:00 【全栈程序员站长】
一、明确几个名称概念:
- 授权链接:跳转授权界面
- 回调地址的作用:在授权页面,点击授权,(授权按钮是第三方提供),如果授权成功,会跳转到回调地址,并且把授权码作为参数传递给我们,然后在通过授权码获取acctoken,再获取Openid。
- openid openid是第三方开放平台对外提供的一个唯一不重复的标识。使用Openid结合自己的网站进行联合登录操作
二、oauth2.0协议获取openid流程
1.生成一个授权码连接,
2.点击授权(跳转的是回调地址,授权码在参数中)通过授权码换取acctoken
3.通过acctoken换取openid
4.通过acctoken+openid换取用户信息。三、关联账号授权登录整体流程
- 跳转授权连接
- 授权成功,跳转回调地址,携带的参数其中有授权码,通过授权码换取acctoken,acctoken换取openid
- 使用openid查询我们数据库,如果存在说明以前关联过账号,放行登录
- 如果使用openid没有查询到,跳转关联账号页面。
- 关联页面分为关联: (1) 新账号相当于注册,同时也要把openId写入数据)。关联好账号同时需要把openid写入数据库中。 (2) 关联原来的账号,先进行登录,在把Openid写入数据库中。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/100802.html原文链接:https://javaforall.cn
边栏推荐
- 【IC5000教程】-01-使用daqIDEA图形化debug调试C代码
- Livedata source code appreciation III - frequently asked questions
- Esp32-c3 introductory tutorial IOT part ⑤ - Alibaba cloud Internet of things platform espaliyun RGB LED practical mass production solution
- 达梦数据冲刺科创板,或成A股市场“国产数据库第一股”
- How to analyze native crash through GDB
- Qt嵌入子Qt程序窗口到当前程序
- 启明星辰集团运维安全网关(堡垒机)再次夺得榜首!
- MCU firmware packaging Script Software
- The reasoning delay on iphone12 is only 1.6 MS! Snap et al. Analyzed the transformer structure latency in detail, and used NAS to find out the efficient network structure of mobile devices
- Compression state DP bit operation
猜你喜欢

19年来最艰难的618,徐雷表达三个谢意

R language view version R package view version

OceanBase 安装 yum 源配置错误及解决办法

国内首批!阿里云云原生数据湖产品通过信通院评测认证

Win10 R package installation error: not installed in arch=i386

A theoretical defect of relative position coding transformer and Its Countermeasures

promise async和await的方法与使用

国产数据库的黄金周期要来了吗?

Mathematics (fast power)
![[IC5000 tutorial] - 01- use daqdea graphical debug to debug C code](/img/54/037b62ff9682ae9fdf861263211043.png)
[IC5000 tutorial] - 01- use daqdea graphical debug to debug C code
随机推荐
阿里云李飞飞:中国云数据库在很多主流技术创新上已经领先国外
Jetpack Compose DropdownMenu跟随手指点击位置显示
datax - 艰难debug路
“新数科技”完成数千万元A+轮融资,造一体化智能数据库云管理平台
Record the memory leak of viewpager + recyclerview once
数据库 事务
SQL必需掌握的100个重要知识点:创建和操纵表
Mathematics (fast power)
Retest the cloud native database performance: polardb is still the strongest, while tdsql-c and gaussdb have little change
Alibaba cloud lifeifei: China's cloud database has taken the lead in many mainstream technological innovations abroad
HMS Core音频编辑服务3D音频技术,助力打造沉浸式听觉盛宴
微信表情符号被写入判决书,你发的每个 emoji 都可能成为呈堂证供
CVPR 2022 | 大幅减少零样本学习所需人工标注,马普所和北邮提出富含视觉信息的类别语义嵌入...
【IC5000教程】-01-使用daqIDEA图形化debug调试C代码
一个人就是一本书
暑假学习记录
[untitled]
【无标题】
Handler source code analysis
100 important knowledge points that SQL must master: creating and manipulating tables