fortigate_-_entra_id_saml_sso
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| fortigate_-_entra_id_saml_sso [2025/12/12 21:36] – [Testing and Validation] oso | fortigate_-_entra_id_saml_sso [2025/12/13 00:22] (current) – [SAML Claim Mapping (Azure → FortiGate)] oso | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Prerequisites ====== | ====== Prerequisites ====== | ||
| - | * Required | + | * Required |
| - | * Certificates and basic setup | + | * A valid public FQDN (sub.domain.tld) for the FortiGate SSL VPN certificate |
| + | * A working certificate on the FortiGate (Let’s Encrypt, public CA, etc.) | ||
| ====== Add FortiGate SSL VPN in Entra ID ====== | ====== Add FortiGate SSL VPN in Entra ID ====== | ||
| - | * Enterprise Applications → Add from Gallery → Select FortiGate SSL VPN | + | * Enterprise Applications → Add from Gallery → Select |
| ====== Configure Basic SAML Settings in Entra ID ====== | ====== Configure Basic SAML Settings in Entra ID ====== | ||
| * Identifier (Entity ID) | * Identifier (Entity ID) | ||
| - | * Reply URL | + | * Reply URL (ACS) |
| * Sign-on URL | * Sign-on URL | ||
| * Logout URL | * Logout URL | ||
| - | * Attribute & Claim mappings | + | * Attribute & Claim mappings |
| - | * Download SAML Signing Certificate | + | * Download |
| + | |||
| + | ===== SAML Claim Mapping (Azure → FortiGate) ===== | ||
| + | |||
| + | FortiGate is strict about SAML attribute names. | ||
| + | The attributes defined in Azure **must match exactly** the attributes that FortiGate expects under: | ||
| + | < | ||
| + | set user-name | ||
| + | set group-name | ||
| + | </ | ||
| + | |||
| + | === Required Claims in Entra ID === | ||
| + | |||
| + | Under **Single Sign-On → User Attributes & Claims**: | ||
| + | |||
| + | **Add this claim** (FortiGate requires the literal name) | ||
| + | * Claim name: '' | ||
| + | |||
| + | **Edit the existing “groups” claim** so that it sends **Group Object IDs** (not display names). | ||
| + | * The expected claim name must be '' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | This ensures that the SAML token contains: | ||
| + | < | ||
| + | username = user@domain | ||
| + | group = <Azure AD Group Object ID> | ||
| + | </ | ||
| + | |||
| + | === Why this matters === | ||
| + | |||
| + | FortiGate matches SAML attributes using the `user-name` and `group-name` fields in the IdP configuration: | ||
| + | |||
| + | < | ||
| + | set user-name " | ||
| + | set group-name " | ||
| + | </ | ||
| + | |||
| + | If the Azure claim sends the wrong attribute or the Object ID doesn' | ||
| + | |||
| + | https:// | ||
| + | ====== Create Test User and Security Group in Entra ID ====== | ||
| + | * Create test user | ||
| + | * Assign user to the FortiGate SSL VPN enterprise app | ||
| + | * Create Security Group (e.g., *FortiGateAccess*) | ||
| + | * Copy the **Object ID** (used later in FortiGate group matching) | ||
| + | |||
| + | ====== Upload Certificate to FortiGate ====== | ||
| + | * Import the SAML IdP certificate into FortiGate | ||
| + | * Rename the certificate if needed for clarity | ||
| + | |||
| + | ====== Configure FortiGate SAML Settings (CLI) ====== | ||
| + | * Define the SAML IdP (`config user saml`) | ||
| + | * Configure entity-id, SSO URLs, IdP URLs, certificate, | ||
| < | < | ||
| config user saml | config user saml | ||
| edit azure | edit azure | ||
| - | set cert < | + | set cert "< |
| set entity-id " | set entity-id " | ||
| set single-sign-on-url " | set single-sign-on-url " | ||
| set single-logout-url " | set single-logout-url " | ||
| + | |||
| set idp-entity-id <Azure AD Identifier> | set idp-entity-id <Azure AD Identifier> | ||
| set idp-single-sign-on-url <Azure Login URL> | set idp-single-sign-on-url <Azure Login URL> | ||
| set idp-single-logout-url <Azure Logout URL> | set idp-single-logout-url <Azure Logout URL> | ||
| - | set idp-cert <Base64 | + | set idp-cert <Azure SAML Base64 |
| set user-name username | set user-name username | ||
| set group-name group | set group-name group | ||
| Line 30: | Line 86: | ||
| end | end | ||
| </ | </ | ||
| - | ====== Create Test User and Security Group in Entra ID ====== | ||
| - | * New user creation | ||
| - | * Assign user to FortiGate SSL VPN app | ||
| - | * Create Security Group (e.g., FortiGateAccess) | ||
| - | * Note Object ID | ||
| - | |||
| - | ====== Upload Certificate to FortiGate ====== | ||
| - | * Import Base64 certificate into FortiGate | ||
| - | * Rename certificate if needed | ||
| - | |||
| - | ====== Configure FortiGate SAML Settings (CLI) ====== | ||
| - | * Define SAML IdP (`config user saml`) | ||
| - | * Map entity-id, single-sign-on-url, | ||
| ====== Configure FortiGate User Group ====== | ====== Configure FortiGate User Group ====== | ||
| - | * Create | + | * Create |
| - | * Match against Azure Security Group Object ID | + | * Match against |
| + | |||
| + | < | ||
| + | config user group | ||
| + | edit AAD-FortiVPN | ||
| + | set member azure | ||
| + | config match | ||
| + | edit 1 | ||
| + | set server-name azure | ||
| + | set group-name 343744cd---GROUP-ID---67bb7e68 | ||
| + | next | ||
| + | end | ||
| + | next | ||
| + | end | ||
| + | </ | ||
| ====== Configure SSL VPN Portals and Firewall Policy ====== | ====== Configure SSL VPN Portals and Firewall Policy ====== | ||
| - | * Create VPN portal(s) | + | * Create |
| - | * Apply firewall | + | * Assign the portal to the SAML group |
| + | * Add firewall | ||
| ====== Optional: Multiple SSL VPN Realms ====== | ====== Optional: Multiple SSL VPN Realms ====== | ||
| - | * Enable SSL-VPN Realms feature | + | * Enable |
| - | * Create multiple realms (e.g., FullTunnel, SplitTunnel) | + | * Create multiple realms (e.g., |
| - | * Configure | + | * Assign specific |
| ====== FortiClient Setup (Optional) ====== | ====== FortiClient Setup (Optional) ====== | ||
| - | * Configure FortiClient for SSL VPN with SAML SSO | + | * Configure FortiClient for SSL VPN using SAML SSO |
| + | * Ensure FQDN and port match the FortiGate SAML configuration | ||
| ====== Testing and Validation ====== | ====== Testing and Validation ====== | ||
| - | * Test SSO via Azure “Test” | + | * Use Azure → “Test” |
| - | * Direct login to FortiGate VPN portal | + | * Direct login to FortiGate VPN portal |
| - | * Use My Apps tile | + | * Launch from MyApps portal |
| - | * Debugging | + | * Use FortiGate debugging |
| < | < | ||
| Line 72: | Line 131: | ||
| diagnose debug enable | diagnose debug enable | ||
| </ | </ | ||
| - | Here the fortigate will output everything related to SSL VPN to the console. | ||
| - | To stop it, paste: | + | To stop debugging: |
| < | < | ||
| diagnose debug reset | diagnose debug reset | ||
| diagnose debug disable | diagnose debug disable | ||
| </ | </ | ||
| - | ====== Troubleshooting Notes ====== | ||
| - | * Certificate re-download after FQDN changes | ||
| - | * Signature verification requirements in FortiOS 7.2.12 / 7.4.9 / 7.6.4 | ||
| - | * Common errors (e.g., “Signature element not found”) | ||
| - | FortiClient | + | FortiClient |
| + | * **20%** – TCP connection | ||
| + | * **40%** – SAML authentication | ||
| + | * **80%** – Tunnel negotiation | ||
| + | * **100%** – Connected | ||
| - | | + | For example, if it fails at **40%**, SAML assertion is not validated. |
| - | | + | |
| - | | + | |
| - | | + | |
| - | So, failing at 40% means the tunnel never starts because | + | ====== Troubleshooting Notes ====== |
| + | * Re-download metadata/ | ||
| + | * Signature validation requirements changed in FortiOS 7.2.12 / 7.4.9 / 7.6.4 | ||
| + | * Common errors (e.g., *" | ||
| + | * Adjust group claim: ensure | ||
| ====== References ====== | ====== References ====== | ||
| Line 97: | Line 157: | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| + | * https:// | ||
fortigate_-_entra_id_saml_sso.1765575390.txt.gz · Last modified: 2025/12/12 21:36 by oso
