当前位置:网站首页>导火索: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去资源服务器获取用户信息就可以做后续的操作了
总结
边栏推荐
- 电竞、便捷、高效、安全,盘点OriginOS功能的关键词
- 无题五
- 偏向锁/轻量锁/重级锁锁锁更健康,上锁解锁到底是怎么完成实现的
- Getting started with Polkadot parachain development, this article is enough
- 自定义过滤器和拦截器实现ThreadLocal线程封闭
- 【AGC】增长服务1-远程配置示例
- 多线程(进阶) - 2.5w字总结
- The technological achievements of Shanghai Konan were selected into the "2021 Shanghai Network Security Industry Innovation Research Achievement Catalog" by the Municipal Commission of Economy and Inf
- MySQL之数据视图
- What is SPL?
猜你喜欢

还在找网盘资源吗?快点收藏如下几个值得收藏的网盘资源搜索神器吧!

MySQL事务

mysql索引

How can project cost control help project success?

Still looking for a network backup resources?Hurry up to collect the following network backup resource search artifact it is worth collecting!

技术干货 | 基于 MindSpore 实现图像分割之豪斯多夫距离

Getting started with Polkadot parachain development, this article is enough

What is CRM Decision Analysis Management?

Huawei's lightweight neural network architecture GhostNet has been upgraded again, and G-GhostNet (IJCV22) has shown its talents on the GPU

5. Deploy the web project to the cloud server
随机推荐
DFINITY 基金会创始人谈熊市沉浮,DeFi 项目该何去何从
three.js debugging tool dat.gui use
你最隐秘的性格在哪?
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
第五章:redis持久化,包括rdb和aof两种方式[通俗易懂]
Is digital transformation a business buy-in?
技术干货 | 基于 MindSpore 实现图像分割之豪斯多夫距离
皕杰报表的下拉框联动
Egg framework usage (2)
js劫持数组push方法
韦东山 数码相框 项目学习(六)tslib的移植
Introduction to SD NAND Flash!
PHP operation mangoDb
What is the function of the regular expression replaceFirst() method?
【MindSpore易点通机器人-01】你也许见过很多知识问答机器人,但这个有点不一样
【AGC】增长服务1-远程配置示例
MySQL之数据视图
Oracle临时表空间作用
首次去中心化抢劫?近2亿美元损失:跨链桥Nomad 被攻击事件分析
uniapp connect ibeacon