0Pricing
OAuth2 & OpenID Connect Deep Dive · บทเรียน

ภาพรวมประเภทการมอบสิทธิ์หลัก

ทำความเข้าใจเบื้องต้นเกี่ยวกับประเภทการมอบสิทธิ์ต่าง ๆ และช่วงเวลาที่มักใช้แต่ละประเภทในสถานการณ์ของแอปพลิเคชันที่หลากหลาย

ภาพรวมประเภทการมอบสิทธิ์หลัก เป็นบทเรียน OAuth2 & OpenID Connect Deep Dive ฟรีบน CoddyKit นี่คือบทเรียนที่ 3 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน OAuth2 & OpenID Connect Deep Dive และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส OAuth2 & OpenID Connect Deep Dive มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

What Are Grant Types?

In OAuth2, Authorization Grant Types are the different methods a client application uses to obtain an access token from the authorization server.

Think of them as various "workflows" or "strategies" tailored for different client types and security needs.

Each type dictates how the client proves its identity and gets permission to access a user's (or its own) resources.

Authorization Code Flow (Web Apps)

This is the most widely recommended and secure grant type, especially for confidential clients like traditional web applications running on a server.

The client exchanges an authorization code (received from the user's browser) for an access token directly with the authorization server. This keeps the access token out of the browser's URL.

Client Credentials Flow (Machine-to-Machine)

The Client Credentials flow is used when a client application needs to access protected resources on its own behalf, rather than on behalf of a user.

There's no user involvement. It's ideal for machine-to-machine communication, like a backend service calling an API, where the client itself is the "resource owner."

Implicit Flow (Client-Side, Deprecated)

Historically, the Implicit flow was used by public clients (like single-page applications or mobile apps) that couldn't securely store a client secret.

It returns the access token directly to the browser via the URL fragment. Due to security concerns (token leakage, no refresh tokens), it is now largely deprecated in favor of the Authorization Code Flow with PKCE.

Resource Owner Password Credentials (Avoid!)

This flow involves the client directly collecting the user's username and password and sending them to the authorization server to obtain an access token.

It's generally highly discouraged because it requires the client to handle sensitive user credentials, which is a major security risk. Only use in highly trusted, first-party legacy applications where no other option exists.

PKCE: Securing Public Clients

With the deprecation of the Implicit Flow, how do public clients (like mobile apps or SPAs) get tokens securely?

The Authorization Code Flow with PKCE (Proof Key for Code Exchange) is the modern answer. PKCE adds a cryptographic protection layer, making the Authorization Code flow safe for clients that cannot hold a secret.

It's now the recommended approach for these client types.

Grant Types at a Glance

Choosing the right grant type depends on your application's nature:

  • Authorization Code: Secure for web server apps. With PKCE, also for mobile/SPAs.
  • Client Credentials: For machine-to-machine API access.
  • Implicit: Largely deprecated, avoid for new development.
  • Resource Owner Password Credentials: Avoid, high security risk.

Access Tokens: The Goal

No matter which grant type you use, the ultimate goal is to obtain an Access Token.

An Access Token is a credential that allows the client to access protected resources on behalf of the user (or itself) from the Resource Server. It's typically a short-lived, opaque string or a JWT.

Why Multiple Workflows?

Different application architectures have varying capabilities to protect sensitive information.

OAuth2 provides these distinct grant types to offer secure options for diverse clients, from backend services to browser-based apps, ensuring appropriate security measures for each context.

Choose the Best Grant Type

A new e-commerce platform wants to allow users to log in using their social media accounts (e.g., Google, Facebook) and grant the platform access to their public profile information. The platform is built as a traditional web application with a backend server.

Recap: Core Grant Types Overview

We've explored the core OAuth2 grant types: Authorization Code (most secure, for web apps and public clients with PKCE), Client Credentials (for machine-to-machine), Implicit (deprecated), and Resource Owner Password Credentials (highly discouraged).

Understanding these different workflows helps you choose the most secure and suitable method for your specific application's authorization needs.

คำถามที่พบบ่อย

บทเรียน “ภาพรวมประเภทการมอบสิทธิ์หลัก” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “ภาพรวมประเภทการมอบสิทธิ์หลัก” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส OAuth2 & OpenID Connect Deep Dive ให้อัปเกรดเป็น CoddyKit PRO คอร์ส OAuth2 & OpenID Connect Deep Dive มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “ภาพรวมประเภทการมอบสิทธิ์หลัก”

ทำความเข้าใจเบื้องต้นเกี่ยวกับประเภทการมอบสิทธิ์ต่าง ๆ และช่วงเวลาที่มักใช้แต่ละประเภทในสถานการณ์ของแอปพลิเคชันที่หลากหลาย คุณปฏิบัติ OAuth2 & OpenID Connect Deep Dive ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน OAuth2 & OpenID Connect Deep Dive หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน OAuth2 & OpenID Connect Deep Dive บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 3 จากทั้งหมด 4 บทเรียน

บทเรียน “ภาพรวมประเภทการมอบสิทธิ์หลัก” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน OAuth2 & OpenID Connect Deep Dive นี้ได้ไหม

ได้ บทเรียน OAuth2 & OpenID Connect Deep Dive ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. OAuth2: โพรโทคอลการมอบสิทธิ์
  2. บทบาทและคำศัพท์ของ OAuth2
  3. ภาพรวมประเภทการมอบสิทธิ์หลัก
  4. โทเค็นเข้าถึง โทเค็นรีเฟรช และขอบเขต
← กลับไปที่ OAuth2 & OpenID Connect Deep Dive