- Mastering OAuth 2.0
- Charles Bihis
- 268字
- 2021-07-30 10:05:13
Let's get started
Up to this point, we have been talking about what OAuth 2.0 is, how it works, and how it is used around us. Now, we will finally be able to look at the process of becoming, and creating, an OAuth 2.0 client. It's really quite simple. The process of building our first OAuth 2.0 client can be broken down into these four easy steps:
- Register your client application.
- Get your access token.
- Use your access token to access a protected resource.
- If applicable, refresh your access token.
Tip
The ability to refresh your access token is only available for trusted clients. In order for a client application to refresh its access token, it must be able to securely store what is called a refresh token. This capability is only available to trusted clients, and therefore, the ability to refresh access tokens is restricted to trusted clients.
You may be wondering how untrusted clients renew their access. We will explain this in the Step 4 – Refresh your access token section later on in this chapter.
This process can be visualized simply with this diagram:

In terms of GoodApp, those steps would be:
- Register the GoodApp application as a client for Facebook.
- Using either the client-side flow or the server-side flow, get an access token.
- Use this access token to get the user's friend list.
- If we used the server-side flow and our access token has expired, use the refresh token to get a new access token.
As you can see, there isn't much to it! Let's start looking at each step a little more closely.
- Visual C++程序設計教程
- ASP.NET Core 5.0開發入門與實戰
- Debian 7:System Administration Best Practices
- Microsoft Application Virtualization Cookbook
- 信息安全技術
- 精通Scrapy網絡爬蟲
- Apache Karaf Cookbook
- Nginx Essentials
- SQL Server 2016數據庫應用與開發習題解答與上機指導
- UML 基礎與 Rose 建模案例(第3版)
- Salesforce Reporting and Dashboards
- FPGA Verilog開發實戰指南:基于Intel Cyclone IV(進階篇)
- Creating Stunning Dashboards with QlikView
- Julia for Data Science
- Python編程快速上手2