当前位置:网站首页>导火索: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去资源服务器获取用户信息就可以做后续的操作了
总结
边栏推荐
猜你喜欢

5. Deploy the web project to the cloud server

JS introduction to reverse the recycling business network of learning, simple encryption mobile phone number

What is CRM Decision Analysis Management?

Voice-based social software development - making the most of its value

three.js调试工具dat.gui使用

首次去中心化抢劫?近2亿美元损失:跨链桥Nomad 被攻击事件分析

leetcode: 529. Minesweeper Game

Confessing in the era of digital transformation: Mai Cong Software allows enterprises to use data in the easiest way

Jenkins manual (2) - software configuration

多线程(进阶) - 2.5w字总结
随机推荐
Pytorch深度学习快速入门教程 -- 土堆教程笔记(三)
第五章:多线程通信—wait和notify
一文道清什么是SPL
七夕浪漫约会不加班,RPA机器人帮你搞定工作
JS introduction to reverse the recycling business network of learning, simple encryption mobile phone number
蚁剑webshell动态加密连接分析与实践
Handwriting Currying - toString Comprehension
项目成本控制如何帮助项目成功?
Custom filters and interceptors implement ThreadLocal thread closure
无题十一
Tanabata romantic date without overtime, RPA robot helps you get the job done
【MindSpore Easy-Diantong Robot-01】You may have seen many knowledge quiz robots, but this one is a bit different
uniapp connect ibeacon
leetcode: 529. 扫雷游戏
Introduction to SD NAND Flash!
IO stream articles -- based on io stream to realize folder copy (copy subfolders and files in subfolders) full of dry goods
SMB + SMB2: Accessing shares return an error after prolonged idle period
第五章:activiti流程分流判断,判断走不同的任务节点
What is the function of the regular expression replaceAll() method?
第五章:redis持久化,包括rdb和aof两种方式[通俗易懂]