ข้ามไปยังเนื้อหาหลัก

ภาพรวม

Casdoor อนุญาตให้ใช้แอปพลิเคชัน OAuth อื่นเป็นวิธีการเข้าสู่ระบบ

ในปัจจุบัน Casdoor รองรับผู้ให้บริการแอปพลิเคชัน OAuth หลายราย ไอคอนของผู้ให้บริการเหล่านี้จะถูกแสดงบนหน้าเข้าสู่ระบบและหน้าสมัครสมาชิกเมื่อได้รับการเพิ่มเข้าไปใน Casdoor ต่อไปนี้คือผู้ให้บริการที่ Casdoor รองรับ:

ผู้ให้บริการโลโก้ผู้ให้บริการโลโก้ผู้ให้บริการโลโก้ผู้ให้บริการโลโก้
ADFSAlipayAmazonApple
Auth0Azure ADAzure AD B2CBaidu
BilibiliBitbucketBoxCasdoor
Cloud FoundryDailymotionDeezerDigitalOcean
DingTalkDiscordTiktokDropbox
Eve OnlineFacebookFitbitGitea
GiteeGitHubGitLabGoogle
HerokuInfluxCloudInfoflowInstagram
IntercomKakaoLarkLastfm
LineLinkedInMailruMeetup
MicrosoftNaverNextcloudOkta
OneDriveOuraPatreonPayPal
QQSalesforceShopifySlack
SoundCloudSpotifySteamStrava
StripeTelegramTikTokTumblr
TwitchTwitterTypetalkUber
VKWeChatWeComWeibo
WePayXeroYahooYammer
YandexZoomอีเมลSMS
Battle.net

เราจะแสดงวิธีการสมัครบริการของบุคคลที่สามและเพิ่มเข้าไปใน Casdoor

สมัครเป็นนักพัฒนา

ก่อนหน้านี้ มีแนวคิดทั่วไปบางอย่างที่คุณต้องเข้าใจ

  • RedirectUrl, ที่อยู่เพื่อเปลี่ยนเส้นทางหลังจากการตรวจสอบสิทธิ์ ให้กรอกที่อยู่แอปพลิเคชันของคุณ เช่น https://forum.casbin.com/
  • Scope, สิทธิ์ที่ผู้ใช้ให้กับคุณ เช่น ข้อมูลโปรไฟล์พื้นฐาน, ที่อยู่อีเมล และโพสต์ และอื่นๆ
  • ClientId/AppId, ClientKey/AppSecret, นี่คือข้อมูลที่สำคัญที่สุด และคุณจำเป็นต้องได้รับหลังจากที่คุณสมัครเป็นนักพัฒนา คุณ ไม่สามารถแชร์ คีย์/ลับกับใครได้

เพิ่มผู้ให้บริการ OAuth

  1. ไปที่หน้าดัชนี Casdoor ของคุณ
  2. คลิกที่ Providers ในแถบด้านบน
  3. คลิกที่ Add, และคุณจะเห็นผู้ให้บริการใหม่ถูกเพิ่มเข้าไปในรายการด้านบน
  4. คลิกที่ผู้ให้บริการใหม่เพื่อทำการเปลี่ยนแปลง
  5. ในส่วนของ Category, เลือก OAuth
  6. เลือกผู้ให้บริการ OAuth ที่คุณต้องการจากเมนูแบบดรอปดาวน์ Type
  7. กรอกข้อมูลที่จำเป็น เช่น Client ID และ Client Secret

User Field Mapping

OAuth providers often return additional user information beyond the standard profile fields. Casdoor's User Mapping feature allows you to automatically populate user profile fields from OAuth claims returned by your identity provider. This is particularly useful when integrating with enterprise identity providers like Okta, Azure AD, or other custom OAuth services that provide rich user metadata.

Automatic Account Linking

When users authenticate via OAuth, Casdoor automatically attempts to link accounts using multiple strategies: existing OAuth links, email/phone matching (if enabled), and case-insensitive username matching. This is particularly useful for enterprises with existing users who want to enable OAuth authentication without requiring manual account linking.

OAuth Provider Token Access

After users authenticate through OAuth providers, Casdoor stores the provider's access token in the user object. Your application can retrieve this token via the /api/get-account API to make authenticated calls to the third-party provider's APIs (e.g., GitHub API, Google Drive API) on behalf of the user. The token is only visible to the user themselves or organization admins. See the OAuth documentation for details.

การตั้งค่าแอปพลิเคชัน

  1. คลิกที่ Application ในแถบด้านบนและเลือกแอปพลิเคชันที่ต้องการแก้ไข
  2. คลิกที่ปุ่มเพิ่มผู้ให้บริการและเลือกผู้ให้บริการที่เพิ่มใหม่
  3. ปรับเปลี่ยนสิทธิ์การใช้งานของผู้ให้บริการ เช่น การเปิดใช้งานการลงทะเบียน การเข้าสู่ระบบ และการยกเลิกการผูก
  4. คุณพร้อมทุกอย่างแล้ว!