当前位置:网站首页>重新理解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
边栏推荐
- dplyr 中的filter报错:Can‘t transform a data frame with duplicate names
- Livedata source code appreciation III - frequently asked questions
- 数学(快速幂)
- 10 days to learn how to flutter Day10 flutter play animation and packaging
- 暑假学习记录
- Alibaba cloud lifeifei: China's cloud database has taken the lead in many mainstream technological innovations abroad
- 据说用了这个,老板连夜把测试开了
- 什么是微信小程序,带你推开小程序的大门
- It's time for the kotlin coroutine to schedule thread switching to solve the mystery
- 从开源项目探讨“FPGA挖矿”的本质
猜你喜欢
![200000 bonus pool! [Alibaba security × ICDM 2022] the risk commodity inspection competition on the large-scale e-commerce map is in hot registration](/img/0e/19c4c97a582d7b2ad08ce806d7af03.jpg)
200000 bonus pool! [Alibaba security × ICDM 2022] the risk commodity inspection competition on the large-scale e-commerce map is in hot registration

It's time for the kotlin coroutine to schedule thread switching to solve the mystery

高通发布物联网案例集 “魔镜”、数字农业已经成为现实

ESP32-C3入门教程 问题篇⑨——Core 0 panic‘ed (Load access fault). Exception was unhandled. vfprintf.c:1528

The jetpack compose dropdownmenu is displayed following the finger click position

对象映射 - Mapping.Mapster

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

HMS core audio editing service 3D audio technology helps create an immersive auditory feast

Filter error in dplyr: can't transform a data frame with duplicate names

Record the memory leak of viewpager + recyclerview once
随机推荐
[xi'anjiaotonguniversity] information sharing of the first and second postgraduate entrance examinations
一个人就是一本书
What is a wechat applet that will open the door of the applet
8 lines of code to achieve quick sorting, easy to understand illustrations!
How harmful are these "unreliable" experiences in the postgraduate entrance examination?
SQL必需掌握的100个重要知识点:分组数据
10 days to learn how to flutter Day10 flutter play animation and packaging
Qt嵌入子Qt程序窗口到当前程序
MCU firmware packaging Script Software
100 important knowledge points that SQL must master: Combined Query
It's time for the kotlin coroutine to schedule thread switching to solve the mystery
Is the golden cycle of domestic databases coming?
Handler source code analysis
Shutter from zero 004 button assembly
Line generation (Gauss elimination method, linear basis)
datax - 艰难debug路
优惠券种类那么多,先区分清楚再薅羊毛!
SQL必需掌握的100个重要知识点:创建和操纵表
Esp32-c3 introductory tutorial question ⑨ - core 0 panic 'ed (load access fault) Exception was unhandled. vfprintf. c:1528
Introduction to China Mobile oneos development board