Passer au contenu principal

Vue d'ensemble

Casdoor peut être configuré pour supporter la connexion des utilisateurs à l'interface utilisateur en utilisant des identités provenant de fournisseurs d'identité externes qui prennent en charge SAML 2.0. Dans cette configuration, Casdoor ne stocke jamais aucune donnée d'identification pour les utilisateurs.

À présent, Casdoor prend en charge plusieurs fournisseurs d'applications SAML. Les icônes des fournisseurs seront affichées sur la page de connexion après avoir été ajoutées à Casdoor. Voici les fournisseurs que Casdoor prend en charge :

Alibaba Cloud IDaaSKeycloakPersonnalisé

Conditions

  • Fournisseur d'Identité (IDP) - Le service qui stocke la base de données d'identité et fournit des services d'identité et d'authentification à Casdoor.
  • Fournisseur de Service (SP) - Le service qui fournit des ressources à l'utilisateur final, dans ce cas, le déploiement de Casdoor.
  • Service de Consommation d'Assertion (ACS) - Le consommateur des assertions SAML générées par le Fournisseur d'Identité.

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.

Comment fonctionne l'intégration SAML

Lors de l'utilisation de SAML SSO, les utilisateurs se connectent à Casdoor via le fournisseur d'identité sans jamais transmettre d'identifiants à Casdoor. La progression est illustrée dans le diagramme suivant.

SAML