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

การเข้าสู่ระบบครั้งเดียวข้ามแอปพลิเคชัน

เรียนรู้วิธีที่ OAuth2 และ OpenID Connect เปิดใช้การเข้าสู่ระบบครั้งเดียว ทำให้ผู้ใช้ยืนยันตัวตนเพียงครั้งเดียวและเข้าถึงหลายแอปพลิเคชันได้อย่างราบรื่น

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

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

What Is SSO?

Single Sign-On lets a user authenticate once with a central identity provider and then access many applications without logging in again. OpenID Connect is the modern foundation for web and mobile SSO.

The Central Session

The magic lives at the OpenID Provider (OP). When the user logs in, the OP establishes its own session (often a cookie). Each app relies on that central session rather than maintaining its own credentials.

First App Login

App A redirects the user to the OP's /authorize endpoint. The user enters credentials, the OP sets its session cookie, and returns an authorization code to App A, which exchanges it for tokens.

Second App: Silent Login

Later the user opens App B, which also redirects to /authorize. Because the OP session cookie already exists, the OP recognizes the user and returns a code without prompting for credentials again. That is the SSO experience.

prompt=none

To check silently whether a session exists, apps can use prompt=none. The OP either returns a code immediately or an error like login_required if no session is present.

GET /authorize?response_type=code
  &client_id=appB&scope=openid
  &redirect_uri=https://b.example.com/cb
  &prompt=none

Forcing Re-authentication

Conversely, sensitive operations can require a fresh login with prompt=login or a max_age constraint, overriding the SSO session for that request.

Identity Provider Federation

The OP itself may federate to upstream providers (corporate IdP, Google, social logins). To the apps it still looks like one OP, but the OP brokers authentication to the chosen source. This centralizes policy and simplifies clients.

Single Logout

SSO needs Single Logout too: when the user signs out of one app, related sessions should end. OIDC offers front-channel and back-channel logout to notify participating apps and clear the central session.

Session Token Lifetimes

Balance convenience and security: short access tokens with refresh tokens for ongoing access, and an OP session lifetime that matches your risk tolerance. Long SSO sessions are convenient but widen the impact of a compromised device.

Native and Mobile SSO

On mobile, SSO uses the system browser (ASWebAuthenticationSession / Custom Tabs) so the OP cookie is shared across apps. Embedded WebViews break SSO and are discouraged for security and usability reasons.

Benefits and Risks

SSO improves UX, centralizes MFA and auditing, and reduces password fatigue. The trade-off: the OP becomes a high-value target, so it must be hardened, monitored, and protected with strong authentication.

Quick Check

Test your SSO understanding.

Recap

Single Sign-On centralizes authentication at the OpenID Provider.

  • The OP session lets subsequent apps log in silently.
  • prompt=none checks for a session; prompt=login/max_age force re-auth.
  • Single Logout coordinates ending sessions across apps.
  • Use the system browser, not embedded WebViews, for mobile SSO.

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

บทเรียน “การเข้าสู่ระบบครั้งเดียวข้ามแอปพลิเคชัน” ฟรีหรือไม่

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

คุณจะเรียนรู้อะไรในบทเรียน “การเข้าสู่ระบบครั้งเดียวข้ามแอปพลิเคชัน”

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

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

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

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

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

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

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

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

  1. การผสานรวมกับผู้ให้บริการอัตลักษณ์
  2. ความปลอดภัยของไมโครเซอร์วิสและเกตเวย์ API
  3. การยืนยันตัวตนหลายปัจจัย (MFA)
  4. การเข้าสู่ระบบครั้งเดียวข้ามแอปพลิเคชัน
← กลับไปที่ OAuth2 & OpenID Connect Deep Dive