SAML SSO with Microsoft Entra ID (Azure AD)¶
Step-by-step guide to integrate Faraday's SAML SSO with Microsoft Entra ID (formerly Azure Active Directory).
Prerequisites: Faraday commercial edition, Microsoft Azure account with permission to manage Enterprise Applications. See See SAML for general SAML configuration reference.
Configuration Summary¶
| Azure Setting | Value |
|---|---|
| Identifier (Entity ID) | https://<domain>/_api/saml/metadata.xml |
| Reply URL (ACS URL) | https://<domain>/_api/saml/acs |
| Faraday Setting | Azure Source |
|---|---|
| Display Name | Faraday (or your preferred label) |
| Identity ID | Microsoft Entra Identifier (e.g., https://sts.windows.net/<tenant-id>/) |
| SSO URL | Login URL (e.g., https://login.microsoftonline.com/<tenant-id>/saml2) |
| IdP Certificate | SAML Certificates → Certificate (Base64) (download) |
| Attribute Identifier | The claim name containing the user identifier (see Attribute Mapping below) |
Replace <domain> with your Faraday server's FQDN throughout.
Step-by-Step Setup¶
Step 1 — Access Azure Portal¶
- Navigate to the Microsoft Azure Portal.
- Sign in with your admin account.
Step 2 — Create an Enterprise Application¶
- Navigate to Enterprise Applications.
- Click New Application.
- Click Create your own application.
Step 3 — Configure Application Type¶
- In the What's the name of your app? field, enter
Faraday. - Select Integrate any other application you don't find in the gallery (Non-gallery).
- Click Create.
Step 4 — Enable SAML Sign-On¶
- On your new application page, go to Single sign-on.
- Click the SAML button to select SAML-based sign-on.
Step 5 — Configure Basic SAML Settings¶
- Click Edit in the Basic SAML Configuration section.
-
Enter the following:
Field Value Identifier (Entity ID) https://<domain>/_api/saml/metadata.xmlReply URL (Assertion Consumer Service URL) https://<domain>/_api/saml/acs -
Click Save.
Step 6 — Configure User Attributes & Claims (Optional)¶
By default, Azure sends the User Principal Name (UPN) as the NameID claim. To customize which attribute is sent as the username:
- Click Edit in the Attributes & Claims section.
- Review or modify the Unique User Identifier (Name ID) claim.
- Add additional claims if needed (e.g.,
email,groups).
Common claim configurations:
| Claim Name | Source Attribute | Description |
|---|---|---|
emailaddress |
user.mail |
User's email address |
name |
user.displayname |
Display name |
groups |
Group claim | Azure AD group memberships |
Step 7 — Download the SAML Certificate¶
- In the SAML Certificates section, find Certificate (Base64).
- Click Download to save the certificate file.
Step 8 — Copy IdP Configuration Values¶
From the Set up Faraday section, copy:
| Azure Field | Faraday Setting |
|---|---|
| Microsoft Entra Identifier | identity_id (Identity ID) — e.g., https://sts.windows.net/<tenant-id>/ |
| Login URL | sso_url (SSO URL) — e.g., https://login.microsoftonline.com/<tenant-id>/saml2 |
Step 9 — Assign Users and Groups¶
- Go to Users and groups in your application settings.
- Click Add user/group.
- Select the users or groups who should have access to Faraday.
- Click Assign.
Step 10 — Generate SP Certificates¶
On your Faraday server, generate the Service Provider certificate pair:
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 1825 -out certificate.pem
certificate.pem→ SP Certificate in Faraday settingskey.pem→ SP Private Key in Faraday settings
Step 11 — Configure Faraday¶
Apply the settings via CLI:
faraday-manage settings -a update saml
Fill in the prompts:
| Prompt | Value |
|---|---|
enabled |
True |
display_name |
Microsoft (or your preferred label) |
user_role |
pentester (recommended default) |
admin_group |
(optional — Azure AD group name for admin mapping) |
attribute_identifier |
The claim name used as username (e.g., emailaddress or the NameID attribute) |
sso_url |
Login URL from Step 8 |
sp_certificate |
Contents of certificate.pem |
sp_private_key |
Contents of key.pem |
idp_certificate |
Contents of downloaded Base64 certificate from Step 7 |
Alternatively, configure via the Web UI at Preferences → Authentication → SAML.
Step 12 — Restart Faraday¶
systemctl restart faraday-server
Step 13 — Test the Integration¶
- Open the Faraday login page.
- Click the SSO button labeled with your
display_name. - Authenticate with your Microsoft credentials.
- Verify you are redirected back to Faraday with an active session.
Attribute Mapping¶
Microsoft Entra ID (Azure AD) sends SAML assertions with claims. The
attribute_identifier setting tells Faraday which claim to use as the
username.
Default Claims¶
Azure AD includes these claims by default:
| Claim | URI | Description |
|---|---|---|
| NameID | (Name Identifier) | Typically the UPN |
emailaddress |
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress |
User's email |
name |
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name |
Display name |
givenname |
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname |
First name |
surname |
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname |
Last name |
Group Claims (Optional)¶
To enable group-based role mapping:
- In Attributes & Claims, click Add a group claim.
- Select Security groups (or the appropriate option).
- Under Source attribute, select Group ID or Display Name.
- Set
admin_groupin Faraday to match the group ID or display name for admin users.
Troubleshooting¶
| Symptom | Cause | Solution |
|---|---|---|
| "AADSTS50105: User not assigned" | User not assigned to the app | Assign the user or their group under Users and groups |
| "Invalid Reply URL" error | ACS URL mismatch | Verify Reply URL is exactly https://<domain>/_api/saml/acs |
| Wrong username in Faraday | attribute_identifier doesn't match the claim sent |
Check Attributes & Claims in Azure and align with attribute_identifier |
| Certificate validation error | Wrong certificate downloaded | Download the Certificate (Base64) specifically (not the Federation Metadata XML) |
| Tenant-specific login fails | Wrong Login URL | Ensure the Login URL includes the correct tenant ID |
| "Unable to sign in" after config change | Faraday server not restarted | Run systemctl restart faraday-server |
Verifying the SAML Response¶
Azure provides a Test button on the Single sign-on page. Use it to:
- Click Test in the Azure SAML configuration.
- Choose Sign in as current user or Sign in as someone else.
- Review the test results for any errors in the assertion.