Übersicht
Casdoor kann so konfiguriert werden, dass Benutzeranmeldungen an der Benutzeroberfläche mit Identitäten von externen Identitätsanbietern möglich sind, die SAML 2.0 unterstützen. In dieser Konfiguration speichert Casdoor niemals irgendwelche Anmeldeinformationen für die Benutzer.
Jetzt unterstützt Casdoor mehrere SAML-Anwendungsanbieter. Symbole der Anbieter werden auf der Anmeldeseite angezeigt, nachdem sie zu Casdoor hinzugefügt wurden. Hier sind die Anbieter, die Casdoor unterstützt:
| Alibaba Cloud IDaaS | Keycloak | Benutzerdefiniert |
|---|---|---|
| ✅ | ✅ | ✅ |
Bedingungen
- Identity Provider (IDP) - Der Dienst, der die Identitätsdatenbank speichert und Identitäts- und Authentifizierungsdienste für Casdoor bereitstellt.
- Service Provider (SP) - Der Dienst, der dem Endbenutzer Ressourcen zur Verfügung stellt, in diesem Fall die Casdoor-Bereitstellung.
- Assertion Consumer Service (ACS) - Der Verbraucher von SAML-Zusicherungen, die vom Identity Provider generiert werden.
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.
Wie SAML-Integration funktioniert
Bei Verwendung von SAML SSO melden sich Benutzer über den Identitätsanbieter bei Casdoor an, ohne jemals Anmeldeinformationen an Casdoor weiterzugeben. Der Fortschritt wird im folgenden Diagramm gezeigt.
