当前位置:网站首页>导火索:OAuth 2.0四种授权登录方式必读
导火索:OAuth 2.0四种授权登录方式必读
2022-08-05 10:09:00 【InfoQ】
- 关于授权登录包含三个端,资源拥有者(用户),资源服务器(存储用户资源的网站),第三方网站。
- OAuth就是用来分离用户和第三方网站的一个层,用户同意之后,资源服务器可以想第三方网站颁发token,第三方网站通过这个token可以访问资源服务器对应这个用户的信息。
OAuth2.0授权的四种方式
前提:不管哪种方式,都需要第三方网站提前到资源服务器注册身份,获取对应的appid和secret,为了防止token被乱用。授权码(authorization-code)
- 首先第三方网站携带appid和secrect和redirect_url到资源服务器取获取登陆二维码
- 用户扫码之后把确认通知传递给资源服务器
- 资源服务器按照第一步的redirect_url返回authorization-code和登陆成功状态
- 第三方获取authorization-code之后再携带自己之前注册的appid和secrect和authorization-code去资源服务器获取token
- 然后第三方网站根据token去资源服务器获取到用户信息之后就可以惊醒后续操作了。
隐藏式(implicit)
- 第三方网站携带appid和secrect和redirect_url到资源服务器取获取登陆二维码
- 用户扫码之后把确认通知传递给资源服务器
- 资源服务器按照第一步的redirect_url返回token和登陆成功状态
- 然后第三方网站根据token去资源服务器获取用户信息就可以做后续的操作了
密码式(password)
- 第三方网站携带username和password到资源服务器取获取token
- 然后第三方网站根据token去资源服务器获取用户信息就可以做后续的操作了
客户端凭证(client credentials)
- 通过在命令行携带appid和secrect到资源服务器取token
- 然后命令行根据token去资源服务器获取用户信息就可以做后续的操作了
总结
边栏推荐
- STM32+ULN2003驱动28BYJ4步进电机(根据圈数正转、反转)
- After Keil upgrades to AC6, what changes?
- 华为轻量级神经网络架构GhostNet再升级,GPU上大显身手的G-GhostNet(IJCV22)
- QSS 选择器
- MySQL data view
- Confessing in the era of digital transformation: Mai Cong Software allows enterprises to use data in the easiest way
- 19.服务器端会话技术Session
- 为什么sys_class 里显示的很多表的 RELTABLESPACE 值为 0 ?
- 【MindSpore易点通机器人-01】你也许见过很多知识问答机器人,但这个有点不一样
- E-sports, convenience, efficiency, security, key words for OriginOS functions
猜你喜欢

气象数据数据处理实例——matlab字符串切割匹配与R语言日期匹配(数据拼接)

【 temperature warning program DE development 】 event driven model instance

2022华数杯数学建模A题环形振荡器的优化设计思路思路代码分享

After Keil upgrades to AC6, what changes?

Meteorological data processing example - matlab string cutting matching and R language date matching (data splicing)

hcip BGP 增强实验

MySQL事务

dotnet OpenXML parsing PPT charts Getting started with area charts

The JVM collection that Alibaba's top architects have summarized for many years, where can't I check it!

Data Middle Office Construction (10): Data Security Management
随机推荐
Meteorological data processing example - matlab string cutting matching and R language date matching (data splicing)
2022华数杯数学建模A题环形振荡器的优化设计思路思路代码分享
Is digital transformation a business buy-in?
The century-old Nordic luxury home appliance brand ASKO smart wine cabinet in the three-temperature area presents the Chinese Valentine’s Day, and tastes the love of the delicacy
蚁剑webshell动态加密连接分析与实践
正则表达式replaceAll()方法具有什么功能呢?
Can MySQL use aggregate functions without GROUP BY?
5. Deploy the web project to the cloud server
JS逆向入门学习之回收商网,手机号码简易加密解析
IO stream articles -- based on io stream to realize folder copy (copy subfolders and files in subfolders) full of dry goods
【AGC】增长服务1-远程配置示例
Open Source Summer | How OpenHarmony Query Device Type (eTS)
STM32+ULN2003 drives 28BYJ4 stepper motor (forward and reverse according to the number of turns)
浅析WSGI协议
华为轻量级神经网络架构GhostNet再升级,GPU上大显身手的G-GhostNet(IJCV22)
uniapp connect ibeacon
Qiu Jun, CEO of Eggplant Technology: Focus on users and make products that users really need
电竞、便捷、高效、安全,盘点OriginOS功能的关键词
我们的Web3创业项目,黄了
JS introduction to reverse the recycling business network of learning, simple encryption mobile phone number