Огляд
Casdoor може бути налаштований для підтримки входу користувачів в UI за допомогою ідентичностей з зовнішніх постачальників ідентичності, які підтримують SAML 2.0. У цій конфігурації Casdoor ніколи не зберігає жодних облікових даних користувачів.
Тепер Casdoor підтримує кілька постачальників додатків SAML. Іконки постачальників будуть відображені на сторінці входу після додавання до Casdoor. Ось постачальники, яких підтримує Casdoor:
| Alibaba Cloud IDaaS | Keycloak | Користувацький |
|---|---|---|
| ✅ | ✅ | ✅ |
Умови
- Постачальник Ідентичності (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/acsRequest Method: The
/api/acsendpoint 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:
- First, it attempts to use the email address from the SAML assertion as the username
- 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. Прогрес показано на наступній діаграмі.
