التخطي إلى المحتوى الرئيسي

نظرة عامة

يمكن تكوين Casdoor لدعم تسجيل دخول المستخدم إلى واجهة المستخدم باستخدام الهويات من مزودي الهوية الخارجيين الذين يدعمون SAML 2.0. في هذا التكوين، لا يخزن Casdoor أي بيانات اعتماد للمستخدمين.

الآن، يدعم Casdoor مزودي تطبيقات SAML متعددين. سيتم عرض أيقونات المزودين على صفحة تسجيل الدخول بعد إضافتها إلى Casdoor. إليك المزودين الذين يدعمهم Casdoor:

Alibaba Cloud IDaaSKeycloakمخصص

الشروط

  • مزود الهوية (IDP) - الخدمة التي تخزن قاعدة بيانات الهوية وتوفر خدمات الهوية والمصادقة لـ Casdoor.
  • مزود الخدمة (SP) - الخدمة التي توفر الموارد للمستخدم النهائي، في هذه الحالة، توزيع Casdoor.
  • خدمة استهلاك الادعاءات (ACS) - المستهلك لادعاءات SAML التي يولدها مزود الهوية.

Configuration Values for Casdoor as SP

When configuring an external Identity Provider (such as Google Workspace, Azure AD, or other SAML IdPs), you'll typically need to provide the following values:

  • ACS URL (Assertion Consumer Service URL): This is the endpoint where the IdP will send SAML assertions. For Casdoor, use: https://<your-casdoor-domain>/api/acs (replace <your-casdoor-domain> with your actual Casdoor domain, e.g., https://door.example.com/api/acs)

  • Entity ID (SP Entity ID): This uniquely identifies your Casdoor instance as a Service Provider. Use the same URL as the ACS URL: https://<your-casdoor-domain>/api/acs

  • Request Method: The /api/acs endpoint only accepts POST requests. Ensure your IdP is configured to send SAML responses via HTTP POST binding.

User Attribute Mapping

When a user authenticates through SAML, Casdoor extracts user information from the SAML assertion based on your provider's attribute mapping configuration. The username field is particularly important as it's required for user identification and creation in Casdoor.

If your IdP doesn't explicitly provide a username mapping or the username field comes back empty, Casdoor automatically applies a fallback strategy:

  1. First, it attempts to use the email address from the SAML assertion as the username
  2. If no email is available, it falls back to the NameID (unique identifier) from the assertion

This fallback mechanism ensures smooth authentication even when username attributes aren't explicitly configured in your IdP, which is common with providers like Azure AD where the default attribute claims might not include a separate username field.

كيفية عمل تكامل SAML

عند استخدام SAML SSO، يقوم المستخدمون بتسجيل الدخول إلى Casdoor عبر مزود الهوية دون تمرير بيانات الاعتماد إلى Casdoor أبدًا. يتم عرض التقدم في الرسم البياني التالي.

SAML