概要
Casdoorは、SAML 2.0をサポートする外部アイデンティティプロバイダーからのアイデンティティを使用してUIへのユーザーログインをサポートするように設定できます。 この設定では、Casdoorはユーザーの資格情報を一切保管しません。
現在、Casdoorは複数のSAMLアプリケーションプロバイダーをサポートしています。 プロバイダーのアイコンは、Casdoorに追加された後、ログインページに表示されます。 Casdoorがサポートするプロバイダーはこちらです:
| Alibaba Cloud IDaaS | Keycloak | カスタム |
|---|---|---|
| ✅ | ✅ | ✅ |
利用規約
- Identity Provider (IDP) - Casdoorに対してアイデンティティデータベースを保管し、アイデンティティと認証サービスを提供するサービス。
- Service Provider (SP) - この場合、Casdoorデプロイメントにエンドユーザーにリソースを提供するサービス。
- Assertion Consumer Service (ACS) - Identity Providerによって生成された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にログインします。 進捗は以下の図に示されています。
