当前位置:网站首页>OAuth 2.0 one click login
OAuth 2.0 one click login
2022-06-25 07:45:00 【Nagging program dog】
OAuth 2.0 Application scenarios
Programmer pairs Gitee and Github No stranger ,Github Probably the earliest time of origin 、 Open source repository with the largest user range ,Gitee As a rising star of domestic code warehouse , The user module is also compatible Github The function of , Such as , stay Gitee The login interface of can be accessed through Github Login by authorization . This is what I want to talk about today OAuth 2.0, You can go Gitee Experience it. UI Interaction process , With a more vivid understanding OAuth 2.0 Authorization process of .


OAuth2.0 Business role

effect :
Make the client secure and controllable ” user “ to grant authorization , Interact with service providers .
OAuth 2.0 Operation process
Excerpt from RFC 6749.

There are five ways to authorize users :
- Authorization code mode (authorization code)
- Simplified mode (implicit)
- Password mode (resource owner password credentials)
- Client mode (client credentials)
Authorization way - With authorization-code For example

The certification process :
- User access client , The client jumps to the authentication server authentication page
- The user selects whether to authorize
- If authorization is selected , Then the user can choose to login by authentication , Such as : Verification Code 、 Account password, etc
- The authentication server issues Authorization Code, Page from the authentication server Redirection URI To Client
- Client take Authorization Code Go to the authentication server
- If the certification is correct , Then issue Access Token/Refresh Token
Information supplement
Access Token: An OAuth Access Token is a string that the OAuth client uses to make requests to the resource server.
Refresh Token: An OAuth Refresh Token is a string that the OAuth client can use to get a new access token without the user’s interaction.
Scope: Scope is a mechanism in OAuth 2.0 to limit an application’s access to a user’s account. An application can request one or more scopes, this information is then presented to the user in the consent screen, and the access token issued to the application will be limited to the scopes granted.
A more visual process - From alicloud
SP: client
IDP: Authentication server
A In the step , The client applies for authentication URI, Contains the following parameters :
- response_type: Indicates the type of Authorization , Will options , The value here is fixed to "code"
- client_id: Represents the ID, Will options
- redirect_uri: Indicates redirection URI, optional . After the authentication server completes the authentication , Redirect to the client's uri
- scope: Indicates the scope of authority of the application , optional
- state: Represents the current state of the client , You can specify any value , The authentication server will return this value intact .
Such as :
http://example.com?code=xxx&state=test&response_type=code&client_id=xxxx&redirect_uri=xxxx.com
C In the step , The server responds to the client's URI, Contains the following parameters :
- code: Indicates authorization code , Will options . The code should be valid for a short period of time , Usually set to 10 minute , The client can only use the code once , Otherwise, it will be rejected by the authorized server . Code and client ID Redirection URI, One to one correspondence .
- state: If the client request contains this parameter , As like as two peas, the authentication server must respond exactly the same .
D In the step , The client applies for the server token , The reference the :
The return value is :
The certification process is complete , Next, you can take the Access Token Get the resources of the server .
to update token
Access Token Generally, there is an expiration time , When accessing, if the client's access token has expired , You need to use ” Update token “ Apply for a new access token . Input use grantType、refreshToken、scope.
边栏推荐
- CGLIB动态代理
- Shell tips (134) simple keyboard input recorder
- VOCALOID笔记
- 海思3559 sample解析:vio
- MySQL face Scripture eight part essay
- Ltpowercad II and ltpowerplanner III
- Pit encountered by pytorch: why can't l1loss decrease during model training?
- Manufacturing process of PCB 2021-10-11
- 函数模板_类模板
- Explain distributed raft with dynamic diagram
猜你喜欢

【批处理DOS-CMD命令-汇总和小结】-文件与目录操作命令(md、rd、xcopy、dir、cd、set、move、copy、del、type、sort)

Evolution of Alibaba e-commerce architecture

Common functions of OrCAD schematic

Summary of small problems in smartbugs installation

Sichuan Tuwei ca-if1051 can transceiver has passed aec-q100 grade 1 certification
![[Batch dos - cmd Command - Summary and Summary] - cmd extension Command, extension Function (CMD / E: on, CMD / E: off)](/img/2b/4495a6cd41a2dd4e7a20ee60b398c9.png)
[Batch dos - cmd Command - Summary and Summary] - cmd extension Command, extension Function (CMD / E: on, CMD / E: off)

【批处理DOS-CMD命令-汇总和小结】-上网和网络通信相关命令(ping、telnet、nslookup、arp、tracert、ipconfig)

用太极拳讲分布式理论,真舒服!

The principle of Zener diode, what is its function?

一次弄清楚 Handler 可能导致的内存泄漏和解决办法
随机推荐
Lebel only wants an asterisk in front of it, but doesn't want to verify it
VectorDraw Web Library 10.10
Tuwei Digital Isolator and interface chip can perfectly replace imported brands Ti and ADI
Modular programming of wireless transmission module nRF905 controlled by single chip microcomputer
音频(五)音频特征提取
【批處理DOS-CMD命令-匯總和小結】-外部命令-cmd下載命令、抓包命令(wget)
Chuantu microelectronics ca-if1051 can-fd transceiver
Different paths ii[dynamic planning improvement for DFS]
海思3559 sample解析:vio
lebel只想前面有星号,但是不想校验
China Mobile MCU product information
指南针可以开股票账户吗?安全吗?
Let's talk about MCU crash caused by hardware problems
搞清信息化是什么,让企业转型升级走上正确的道路
Chuantu microelectronics breaks through the high-end isolator analog chip market with ca-is3062w
國外LEAD域名郵箱獲取途徑
(tool class) use SecureCRT as the communication medium
el-input实现尾部加字
Sichuan earth microelectronics ca-is1300 isolated operational amplifier for current detection is on the market
Debian introduction


