Skip to content

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

  1. Navigate to the Microsoft Azure Portal.
  2. Sign in with your admin account.

Step 2 — Create an Enterprise Application

  1. Navigate to Enterprise Applications.
  2. Click New Application.
  3. Click Create your own application.

Step 3 — Configure Application Type

  1. In the What's the name of your app? field, enter Faraday.
  2. Select Integrate any other application you don't find in the gallery (Non-gallery).
  3. Click Create.

Step 4 — Enable SAML Sign-On

  1. On your new application page, go to Single sign-on.
  2. Click the SAML button to select SAML-based sign-on.

Step 5 — Configure Basic SAML Settings

  1. Click Edit in the Basic SAML Configuration section.
  2. Enter the following:

    Field Value
    Identifier (Entity ID) https://<domain>/_api/saml/metadata.xml
    Reply URL (Assertion Consumer Service URL) https://<domain>/_api/saml/acs
  3. 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:

  1. Click Edit in the Attributes & Claims section.
  2. Review or modify the Unique User Identifier (Name ID) claim.
  3. 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

  1. In the SAML Certificates section, find Certificate (Base64).
  2. 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

  1. Go to Users and groups in your application settings.
  2. Click Add user/group.
  3. Select the users or groups who should have access to Faraday.
  4. 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.pemSP Certificate in Faraday settings
  • key.pemSP 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

  1. Open the Faraday login page.
  2. Click the SSO button labeled with your display_name.
  3. Authenticate with your Microsoft credentials.
  4. 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:

  1. In Attributes & Claims, click Add a group claim.
  2. Select Security groups (or the appropriate option).
  3. Under Source attribute, select Group ID or Display Name.
  4. Set admin_group in 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:

  1. Click Test in the Azure SAML configuration.
  2. Choose Sign in as current user or Sign in as someone else.
  3. Review the test results for any errors in the assertion.