当前位置:网站首页>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.
边栏推荐
- 点云智绘在智慧工地中的应用
- [pytest] modify the logo and parameterization in the allure Report
- 用太极拳讲分布式理论,真舒服!
- useMemo模拟useCallback
- Explain distributed raft with dynamic diagram
- Find out what informatization is, and let enterprises embark on the right path of transformation and upgrading
- 数据可视化没有重点怎么办?
- 【QT】Qt 5 的程序:打印文档
- Function template_ Class template
- 【批处理DOS-CMD命令-汇总和小结】-应用程序启动和调用、服务和进程操作命令(start、call、)
猜你喜欢

栅格地图(occupancy grid map)构建

Unity3D邪门实现之GUI下拉菜单Dropdown设计无重复项

Debian introduction

CPDA | how to start the growth path of data analysts?

Intel announced five new technological developments, including quantum computing, neural pseudo computing, machine programming, integrated optoelectronics, and secure computing
![[batch dos-cmd command - summary and summary] - external command -cmd download command and packet capture command (WGet)](/img/00/5a5b081b78ad6a6c1c3a3c847dd315.png)
[batch dos-cmd command - summary and summary] - external command -cmd download command and packet capture command (WGet)

Tempest HDMI leak receive 1
![[distillation] pointdistiller: structured knowledge distillationwards efficient and compact 3D detection](/img/5c/ad42474a363c33ecc0e01890b65bbf.png)
[distillation] pointdistiller: structured knowledge distillationwards efficient and compact 3D detection

Four software 2021-10-14 suitable for beginners to draw PCB

无“米”,也能煮“饭”利用“点云智绘”反演机载LiDAR林下缺失地面点攻略
随机推荐
Collection of common terms and meanings in forestry investigation based on lidar
【批处理DOS-CMD命令-汇总和小结】-CMD窗口的设置与操作命令(cd、title、mode、color、pause、chcp、exit)
[batch dos-cmd command - summary and summary] - CMD extended command and function (CMD /e:on, CMD /e:off)
Audio (V) audio feature extraction
OpenMP入门
Sichuan earth microelectronics ca-is1200 isolated operational amplifier for current detection
Modular programming of oled12864 display controlled by single chip microcomputer
无“米”,也能煮“饭”利用“点云智绘”反演机载LiDAR林下缺失地面点攻略
Storage of Galileo broadcast ephemeris in rtklib-b33
My debut is finished!
[Batch dos - cmd Command - Summary and Summary] - cmd extension Command, extension Function (CMD / E: on, CMD / E: off)
Chuantu microelectronics high speed and high performance rs-485/422 transceiver series
Cglib dynamic proxy
Distributed quorum NWR of the alchemy furnace of the Supreme Master
Sichuan earth microelectronics high performance, high integration and low cost isolated 485 transceiver
IAR compiler flashback
Keil and Proteus joint commissioning
一“石”二“鸟”,PCA有效改善机载LiDAR林下地面点部分缺失的困局
Tempest HDMI leak receive 2
The principle of Zener diode, what is its function?


