当前位置:网站首页>导火索: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去资源服务器获取用户信息就可以做后续的操作了
总结
边栏推荐
- 公众号如何运维?公众号运维专业团队
- 基于MindSpore高效完成图像分割,实现Dice!
- 什么是CRM决策分析管理?
- Microservice Technology Stack
- Complete image segmentation efficiently based on MindSpore and realize Dice!
- 第八章:activiti多用户任务分配
- 【 temperature warning program DE development 】 event driven model instance
- Analysis and practice of antjian webshell dynamic encrypted connection
- 第五章:多线程通信—wait和notify
- Jenkins manual (2) - software configuration
猜你喜欢
High-quality DeFi application building guide to help developers enjoy DeFi Summer
IDEA执行Test操作导致数据插入时出现了重复数据
STM32+ULN2003 drives 28BYJ4 stepper motor (forward and reverse according to the number of turns)
数据中台建设(十):数据安全管理
leetcode: 529. 扫雷游戏
Bias lock/light lock/heavy lock lock is healthier. How is locking and unlocking accomplished?
JS introduction to reverse the recycling business network of learning, simple encryption mobile phone number
气象数据数据处理实例——matlab字符串切割匹配与R语言日期匹配(数据拼接)
E-sports, convenience, efficiency, security, key words for OriginOS functions
创建一个 Dapp,为什么要选择波卡?
随机推荐
技术干货 | 基于 MindSpore 实现图像分割之豪斯多夫距离
无题一
Our Web3 Entrepreneurship Project, Yellow
2022华数杯数学建模思路分析交流
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
无题五
Qiu Jun, CEO of Eggplant Technology: Focus on users and make products that users really need
电竞、便捷、高效、安全,盘点OriginOS功能的关键词
egg框架使用(一)
自定义过滤器和拦截器实现ThreadLocal线程封闭
E-sports, convenience, efficiency, security, key words for OriginOS functions
【 temperature warning program DE development 】 event driven model instance
开源一夏|OpenHarmony如何查询设备类型(eTS)
Imitation SBUS fixed with serial data conversion
使用工具类把对象中的null值转换为空字符串(集合也可以使用)
项目成本控制如何帮助项目成功?
hcip BGP enhancement experiment
The JVM collection that Alibaba's top architects have summarized for many years, where can't I check it!
Tanabata romantic date without overtime, RPA robot helps you get the job done
JS introduction to reverse the recycling business network of learning, simple encryption mobile phone number