บทบาทและคำศัพท์ของ OAuth2
ทำความเข้าใจผู้มีบทบาทสำคัญ ได้แก่ เจ้าของทรัพยากร ไคลเอ็นต์ เซิร์ฟเวอร์อนุญาตสิทธิ์ และเซิร์ฟเวอร์ทรัพยากร รวมถึงการโต้ตอบระหว่างกัน
บทบาทและคำศัพท์ของ OAuth2 เป็นบทเรียน OAuth2 & OpenID Connect Deep Dive ฟรีบน CoddyKit นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน OAuth2 & OpenID Connect Deep Dive และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส OAuth2 & OpenID Connect Deep Dive มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
Intro to OAuth2 Roles
Welcome! OAuth2 involves several key players working together. Understanding each role is crucial to grasp how it secures access to your data without sharing your password.
Let's meet the main characters in the OAuth2 story!
The Resource Owner: You!
The Resource Owner is typically you, the end-user. You own the protected resources (like your photos, contacts, or profile information) stored on a service.
- You grant permission to applications to access your resources.
- You never directly share your password with the application.
The Client Application
The Client Application (or just "Client") is the application that wants to access your protected resources. This could be a mobile app, a web application, or even another server-side application.
- It needs your permission to act on your behalf.
- It doesn't store your credentials.
The Authorization Server
The Authorization Server (AuthZ Server) is the core of OAuth2. It's responsible for:
- Authenticating the Resource Owner (you).
- Obtaining your consent for the Client.
- Issuing access tokens to the Client.
Think of it as the trusted authority that manages permissions.
The Resource Server
The Resource Server is where your protected resources actually live. This is the API server that holds your photos, emails, or other data.
- It receives requests from the Client.
- It validates the access token presented by the Client.
- If the token is valid, it grants access to the requested resources.
Roles in Action: Simple Flow
Here's a simplified look at how these roles interact:
- The Client asks the Resource Owner for permission.
- The Resource Owner interacts with the Authorization Server to grant consent.
- The Authorization Server gives an access token to the Client.
- The Client uses this token to request resources from the Resource Server.
Example: Photo Printing App
Let's say you use a "Print My Photos" app (Client) to print pictures from your Google Photos (Resource Server).
Instead of giving the app your Google password, Google (Authorization Server) asks you if the app can access your photos. You say "Yes," Google gives the app a special token, and the app uses that token to get your photos.
Access Tokens: The Keys
When the Authorization Server issues an access token, it's like giving the Client a temporary, specific key.
- This key only unlocks certain resources (defined by "scopes").
- It has a limited lifespan.
- If lost, it doesn't expose your main password.
We'll cover tokens in more detail later!
The Chain of Trust
OAuth2 builds a chain of trust:
- The Resource Owner trusts the Authorization Server to handle their consent.
- The Client trusts the Authorization Server to issue valid tokens.
- The Resource Server trusts the Authorization Server to verify tokens it receives.
This allows secure delegation without password sharing.
Quick Check: Identify Role
Consider a mobile banking app that wants to display your transaction history from your bank's API.
Which OAuth2 role represents the mobile banking app?
Recap: The Core Players
In this lesson, we identified the four fundamental roles in OAuth2:
- Resource Owner: The user who owns the data.
- Client Application: The app requesting access.
- Authorization Server: Manages user consent and issues tokens.
- Resource Server: Hosts the protected data and validates tokens.
Understanding these roles is vital for grasping OAuth2's secure delegation model. Next, we'll look at the different ways these roles interact through "grant types"!
คำถามที่พบบ่อย
บทเรียน “บทบาทและคำศัพท์ของ OAuth2” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “บทบาทและคำศัพท์ของ OAuth2” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส OAuth2 & OpenID Connect Deep Dive ให้อัปเกรดเป็น CoddyKit PRO คอร์ส OAuth2 & OpenID Connect Deep Dive มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “บทบาทและคำศัพท์ของ OAuth2”
ทำความเข้าใจผู้มีบทบาทสำคัญ ได้แก่ เจ้าของทรัพยากร ไคลเอ็นต์ เซิร์ฟเวอร์อนุญาตสิทธิ์ และเซิร์ฟเวอร์ทรัพยากร รวมถึงการโต้ตอบระหว่างกัน คุณปฏิบัติ OAuth2 & OpenID Connect Deep Dive ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน OAuth2 & OpenID Connect Deep Dive หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน OAuth2 & OpenID Connect Deep Dive บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน
บทเรียน “บทบาทและคำศัพท์ของ OAuth2” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน OAuth2 & OpenID Connect Deep Dive นี้ได้ไหม
ได้ บทเรียน OAuth2 & OpenID Connect Deep Dive ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- OAuth2: โพรโทคอลการมอบสิทธิ์
- บทบาทและคำศัพท์ของ OAuth2
- ภาพรวมประเภทการมอบสิทธิ์หลัก
- โทเค็นเข้าถึง โทเค็นรีเฟรช และขอบเขต