ภาพรวม
Casdoor อนุญาตให้ใช้แอปพลิเคชัน OAuth อื่นเป็นวิธีการเข้าสู่ระบบ
ในปัจจุบัน Casdoor รองรับผู้ให้บริการแอปพลิเคชัน OAuth หลายราย ไอคอนของผู้ให้บริการเหล่านี้จะถูกแสดงบนหน้าเข้าสู่ระบบและหน้าสมัครสมาชิกเมื่อได้รับการเพิ่มเข้าไปใน Casdoor ต่อไปนี้คือผู้ให้บริการที่ Casdoor รองรับ:
| ผู้ให้บริการ | โลโก้ | ผู้ให้บริการ | โลโก้ | ผู้ให้บริการ | โลโก้ | ผู้ให้บริการ | โลโก้ |
|---|---|---|---|---|---|---|---|
| ADFS | Alipay | Amazon | Apple | ||||
| Auth0 | Azure AD | Azure AD B2C | Baidu | ||||
| Bilibili | Bitbucket | Box | Casdoor | ||||
| Cloud Foundry | Dailymotion | Deezer | DigitalOcean | ||||
| DingTalk | Discord | Tiktok | Dropbox | ||||
| Eve Online | Fitbit | Gitea | |||||
| Gitee | GitHub | GitLab | |||||
| Heroku | InfluxCloud | Infoflow | |||||
| Intercom | Kakao | Lark | Lastfm | ||||
| Line | Mailru | Meetup | |||||
| Microsoft | Naver | Nextcloud | Okta | ||||
| OneDrive | Oura | Patreon | PayPal | ||||
| Salesforce | Shopify | Slack | |||||
| SoundCloud | Spotify | Steam | Strava | ||||
| Stripe | Telegram | TikTok | Tumblr | ||||
| Twitch | Typetalk | Uber | |||||
| VK | WeCom | ||||||
| WePay | Xero | Yahoo | Yammer | ||||
| Yandex | Zoom | อีเมล | SMS | ||||
| Battle.net |
เราจะแสดงวิธีการสมัครบริการของบุคคลที่สามและเพิ่มเข้าไปใน Casdoor
สมัครเป็นนักพัฒนา
ก่อนหน้านี้ มีแนวคิดทั่วไปบางอย่างที่คุณต้องเข้าใจ
- RedirectUrl, ที่อยู่เพื่อเปลี่ยนเส้นทางหลังจากการตรวจสอบสิทธิ์ ให้กรอกที่อยู่แอปพลิเคชันของคุณ เช่น
https://forum.casbin.com/ - Scope, สิทธิ์ที่ผู้ใช้ให้กับคุณ เช่น ข้อมูลโปรไฟล์พื้นฐาน, ที่อยู่อีเมล และโพสต์ และอื่นๆ
- ClientId/AppId, ClientKey/AppSecret, นี่คือข้อมูลที่สำคัญที่สุด และคุณจำเป็นต้องได้รับหลังจากที่คุณสมัครเป็นนักพัฒนา คุณ ไม่สามารถแชร์ คีย์/ลับกับใครได้
เพิ่มผู้ให้บริการ OAuth
- ไปที่หน้าดัชนี Casdoor ของคุณ
- คลิกที่
Providersในแถบด้านบน - คลิกที่
Add, และคุณจะเห็นผู้ให้บริการใหม่ถูกเพิ่มเข้าไปในรายการด้านบน - คลิกที่ผู้ให้บริการใหม่เพื่อทำการเปลี่ยนแปลง
- ในส่วนของ
Category, เลือกOAuth - เลือกผู้ให้บริการ OAuth ที่คุณต้องการจากเมนูแบบดรอปดาวน์
Type - กรอกข้อมูลที่จำเป็น เช่น
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.
การตั้งค่าแอปพลิเคชัน
- คลิกที่
Applicationในแถบด้านบนและเลือกแอปพลิเคชันที่ต้องการแก้ไข - คลิกที่ปุ่มเพิ่มผู้ให้บริการและเลือกผู้ให้บริการที่เพิ่มใหม่
- ปรับเปลี่ยนสิทธิ์การใช้งานของผู้ให้บริการ เช่น การเปิดใช้งานการลงทะเบียน การเข้าสู่ระบบ และการยกเลิกการผูก
- คุณพร้อมทุกอย่างแล้ว!