ServiceNow integration with Microsoft Entra ID (Azure AD) enables centralized identity management, single sign-on authentication, and automated user provisioning for organizations using Microsoft's cloud identity platform. This integration solves the critical business challenge of maintaining synchronized user access across enterprise systems while reducing administrative overhead and improving security posture through centralized identity governance. The integration supports bi-directional data flows including inbound user and group synchronization via LDAP or REST APIs, outbound authentication requests through SAML 2.0 SSO, and real-time user attribute updates triggered by changes in Azure AD. The primary components reside in ServiceNow's System Security module for SSO configuration and the MID Server infrastructure for LDAP connectivity, with additional group-to-role mapping handled through the User Administration module.
Prerequisites
- •ServiceNow Vancouver or later instance with System Administrator role
- •Microsoft Entra ID (Azure AD) Premium P1 or P2 license for conditional access policies
- •ServiceNow MID Server installed and operational for LDAP connectivity
- •Azure AD Global Administrator or Application Administrator privileges
- •Integration Hub Starter license or higher for Microsoft Graph API operations
- •Network connectivity between MID Server and Azure AD domain controllers on ports 389/636
- •Valid SSL certificate configured on ServiceNow instance for SAML assertions
Architecture Overview
The ServiceNow Azure AD integration utilizes multiple components including the Microsoft Graph spoke in Integration Hub for REST-based operations, native SAML 2.0 capabilities for SSO authentication, and MID Server-based LDAP connector for directory synchronization. Authentication credentials are stored securely using Connection & Credential Aliases in ServiceNow, with SAML certificates managed through the System Certificates module and API tokens stored as Basic Auth or OAuth 2.0 credentials. Data flows are primarily inbound from Azure AD to ServiceNow, triggered by scheduled imports for user/group data and real-time for SSO assertions, though outbound flows occur for authentication requests and optional user attribute updates. A MID Server is required for LDAP-based user imports as it provides the necessary directory protocol support and handles secure communication with Azure AD domain controllers behind corporate firewalls. Microsoft Graph API operations are subject to throttling limits of 10,000 requests per 10-minute period per application, while LDAP operations depend on domain controller capacity and network latency between the MID Server and Azure infrastructure.
Sourdough: ServiceNow Monitoring and Analytics
A Chrome extension for ServiceNow Admins and Developers with essential tools, analytics, graphs and monitoring features.
Free to install. Pro $5/month after a 14-day no-card trial.
Pro requires the ServiceNow admin role. Upgrade inside the extension.
Implementation Steps
Configure Azure AD Application Registration for ServiceNow
Navigate to the Azure Portal and access Azure Active Directory > App registrations > New registration to create a ServiceNow application. Set the application name to 'ServiceNow SSO' and configure the redirect URI as 'https://your-instance.service-now.com/navpage.do' for production instances. Record the Application (client) ID and generate a client secret under Certificates & secrets, noting that secrets expire and require rotation. Under API permissions, add Microsoft Graph delegated permissions for User.Read and Group.Read.All to enable user attribute retrieval during SSO flows.
Create Connection and Credential Aliases in ServiceNow
Navigate to Connections & Credentials > Credential in ServiceNow and create a new Basic Auth credential with the Azure AD service account username and password for LDAP operations. For Microsoft Graph API access, create an OAuth 2.0 credential using the client ID and secret from step 1, setting the token URL to 'https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token'. Create a Connection Alias record pointing to your Azure AD tenant endpoints, ensuring the connection URL uses the correct tenant-specific URLs. Test the credential by clicking Test Connection to verify authentication succeeds before proceeding to configuration steps.
// Test Microsoft Graph API connection
var r = new sn_ws.RESTMessageV2('Microsoft Graph', 'GET');
r.setEndpoint('https://graph.microsoft.com/v1.0/users?$top=1');
r.setAuthenticationProfile('oauth2', 'azure_ad_oauth_credential');
var response = r.execute();
gs.info('Graph API Response: ' + response.getStatusCode() + ' - ' + response.getBody());Configure SAML 2.0 Single Sign-On Authentication
Navigate to System Security > Single Sign-On > Identity Providers and create a new SAML 2.0 provider with the name 'Azure AD SSO'. Configure the Identity Provider URL using Azure AD's SAML endpoint 'https://login.microsoftonline.com/{tenant-id}/saml2' and upload the Azure AD signing certificate downloaded from the Azure portal. Set the Name ID format to 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent' and configure attribute mapping for user_name, email, first_name, and last_name fields. Enable the identity provider and copy the ServiceNow SAML metadata URL to configure in Azure AD's Enterprise Application SAML settings, ensuring the Assertion Consumer Service URL matches your ServiceNow instance.
Setup MID Server LDAP Integration for User Import
Navigate to MID Server > LDAP Servers and create a new LDAP server configuration pointing to your Azure AD Connect synchronized domain controller or Azure AD Domain Services instance. Configure the server URL as 'ldaps://your-domain.com:636' for secure LDAP, using the credential alias created in step 2 for authentication. Set the base DN to your organization's root (e.g., 'DC=contoso,DC=com') and configure user and group search filters to target the appropriate organizational units. Test the LDAP connection through the MID Server's agent logs to ensure successful binding and query execution before proceeding with import configuration.
// LDAP connection test script for MID Server
var ldapServer = new GlideRecord('ldap_server_config');
ldapServer.get('name', 'Azure AD LDAP');
var testResult = new LDAPConnectionTest(ldapServer);
if (testResult.testConnection()) {
gs.info('LDAP connection successful to Azure AD');
} else {
gs.error('LDAP connection failed: ' + testResult.getErrorMessage());
}Configure User Import and Data Source Mapping
Navigate to User Administration > Import Sets > Data Sources and create a new LDAP data source linked to the LDAP server configured in step 4. Define the import set table structure with columns for user_name, first_name, last_name, email, department, and manager fields that correspond to Azure AD attributes. Create transform maps to populate the sys_user table, ensuring proper field mapping between LDAP attributes (e.g., sAMAccountName to user_name, mail to email) and ServiceNow user fields. Configure coalesce conditions on user_name and email to prevent duplicate user creation and enable the 'Update existing records' option for ongoing synchronization.
// Transform script for Azure AD user import
(function runTransformScript(source, map, log, target) {
// Map Azure AD department to ServiceNow department
if (source.department) {
var dept = new GlideRecord('cmn_department');
dept.addQuery('name', source.department.toString());
dept.query();
if (dept.next()) {
target.department = dept.sys_id;
}
}
// Set user to active if account is enabled in AD
target.active = (source.userAccountControl != '514');
})(source, map, log, target);Implement Group-to-Role Mapping and Automated Assignment
Navigate to User Administration > Groups and create ServiceNow groups that correspond to Azure AD security groups, ensuring consistent naming conventions for easier management. Configure LDAP group import using the same data source methodology as user import, creating transform maps that populate the sys_user_grmember table for group memberships. Create business rules or scheduled jobs that automatically assign ServiceNow roles based on group membership, using role assignment conditions that evaluate group membership changes. Implement role inheritance logic to ensure users receive appropriate access levels based on their Azure AD group assignments while maintaining principle of least privilege.
// Business rule for automatic role assignment based on AD groups
(function executeRule(current, previous) {
var groupName = current.group.name.toString();
var userId = current.user.toString();
// Map Azure AD groups to ServiceNow roles
var roleMap = {
'ServiceNow_Admins': 'admin',
'ServiceNow_ITILUsers': 'itil',
'ServiceNow_EndUsers': 'snc_external'
};
if (roleMap[groupName]) {
var gr = new GlideRecord('sys_user_has_role');
gr.initialize();
gr.user = userId;
gr.role = roleMap[groupName];
gr.insert();
}
})(current, previous);Configure Azure AD Conditional Access Policies for ServiceNow
In the Azure Portal, navigate to Security > Conditional Access and create a new policy specifically for ServiceNow application access. Configure user and group assignments to target the appropriate user populations, excluding service accounts and break-glass administrative accounts from restrictive policies. Set conditions based on sign-in risk, device compliance, and location requirements that align with your organization's security posture, such as requiring MFA for external access or blocking access from untrusted locations. Enable session controls for application enforced restrictions and configure monitoring alerts to track policy violations and authentication failures.
Test Integration and Configure Monitoring
Perform end-to-end testing by attempting SSO login from Azure AD to ServiceNow, verifying user attributes are correctly mapped and roles are properly assigned based on group membership. Execute manual LDAP import operations to validate user and group synchronization, checking import set tables for any transformation errors or failed records. Configure automated monitoring by setting up scheduled LDAP imports, enabling email notifications for import failures, and creating ServiceNow events for authentication errors. Establish operational procedures for certificate rotation, credential management, and regular testing of the integration components to ensure continued functionality.
// Monitoring script for Azure AD integration health
var healthCheck = {
checkLDAPConnection: function() {
var ldap = new GlideRecord('ldap_server_config');
ldap.get('name', 'Azure AD LDAP');
return ldap.isValidRecord() && ldap.active;
},
checkRecentImports: function() {
var importRun = new GlideRecord('sys_import_set_run');
importRun.addQuery('sys_created_on', '>', gs.daysAgoStart(1));
importRun.addQuery('state', 'complete');
importRun.query();
return importRun.hasNext();
}
};
gs.info('Azure AD Integration Health: LDAP=' + healthCheck.checkLDAPConnection() + ', Imports=' + healthCheck.checkRecentImports());Common Use Cases
Automated User Provisioning and Deprovisioning
When employees join or leave the organization, their Azure AD account status changes trigger automatic user creation or deactivation in ServiceNow through scheduled LDAP imports. The integration creates new sys_user records with appropriate group memberships and role assignments based on their department and job function attributes from Azure AD. This eliminates manual user management overhead and ensures consistent access provisioning across the organization while maintaining audit trails for compliance purposes.
Department-Based Access Control and Role Assignment
Azure AD security groups organized by department or job function automatically map to ServiceNow roles through group membership synchronization and business rule automation. Users in the IT department Azure AD group receive ITIL user roles, while managers receive approval rights and executives get elevated dashboard access. This dynamic role assignment ensures users have appropriate permissions based on their organizational position while simplifying access management for ServiceNow administrators.
Conditional Access Enforcement for High-Risk Scenarios
Azure AD conditional access policies evaluate sign-in risk, device compliance, and geographic location to enforce additional security controls when accessing ServiceNow. High-risk sign-ins trigger multi-factor authentication requirements, while access from unknown locations may be blocked entirely or require additional verification steps. This integration extends Azure AD's intelligent security capabilities to protect ServiceNow data while maintaining user experience for legitimate access scenarios.
Executive Dashboard SSO with Attribute-Based Personalization
C-level executives use Azure AD SSO to access customized ServiceNow dashboards with their department and title attributes automatically populating personalized views and KPIs. The SAML assertion carries executive-specific attributes that trigger role assignments for sensitive reports and strategic project visibility. This seamless integration eliminates separate login credentials while ensuring executives see relevant organizational metrics based on their Azure AD profile information.
Service Desk Agent Authentication with Group-Based Queue Assignment
Help desk agents authenticate through Azure AD SSO and are automatically assigned to appropriate support queues based on their Azure AD group memberships representing specializations like network support or application support. The integration maps Azure AD groups to ServiceNow assignment groups, ensuring incoming tickets route to qualified agents without manual intervention. This streamlines service desk operations while maintaining proper segregation of duties based on agent expertise and clearance levels.
Troubleshooting
SAML assertion signature verification failures causing SSO login errors
Navigate to System Security > Certificates and verify the Azure AD signing certificate is current and properly imported without encoding issues. Check the System Logs for specific certificate validation errors and compare the certificate thumbprint with Azure AD's current signing certificate in the portal. If certificates have been rotated, download the new certificate from Azure AD and replace the expired certificate in ServiceNow, ensuring the Identity Provider configuration references the correct certificate record.
LDAP import failures with connection timeout or authentication errors
Review MID Server agent logs for specific LDAP bind failures and verify the credential alias contains current service account credentials that haven't expired. Test network connectivity between MID Server and Azure AD domain controllers using telnet or nmap to ensure ports 389 or 636 are accessible. If using Azure AD Domain Services, confirm the service is running and the managed domain password hasn't expired, then update the ServiceNow credential record with the current password.
Users created through LDAP import missing expected group memberships and role assignments
Check the LDAP data source configuration to ensure group membership queries include the appropriate organizational units and group types in Azure AD. Verify transform map scripts are correctly parsing group DN attributes and creating sys_user_grmember records during import processing. Review business rules that handle role assignment to ensure they're triggering on group membership changes and that role names match exactly between the mapping logic and ServiceNow role records.
Microsoft Graph API calls returning 401 Unauthorized errors for user attribute retrieval
Verify the OAuth 2.0 credential configuration includes the correct tenant ID and client secret hasn't expired in Azure AD app registration settings. Check that required Microsoft Graph API permissions are granted and admin consent has been provided for application permissions like User.Read.All. Test the credential manually using the REST API Explorer and review System Logs for specific error messages that indicate whether the issue is authentication-related or permission-based.
Conditional access policies blocking legitimate ServiceNow access for remote workers
Review Azure AD Sign-in logs to identify specific conditional access policy rules that are triggering blocks and evaluate whether location-based restrictions are too restrictive. Consider creating exception groups for ServiceNow administrators or implementing device compliance requirements instead of location-based blocks. Configure trusted locations in Azure AD to include known office locations and VPN exit points, then test policy changes with a pilot group before applying to all users.
Duplicate user records created during LDAP import despite coalesce field configuration
Examine the import set source data for variations in user identifiers like email address formatting or username case sensitivity that prevent proper matching. Verify coalesce field configuration includes both user_name and email fields with case-insensitive matching enabled in the transform map settings. Review existing sys_user records for data quality issues like trailing spaces or special characters that might interfere with coalesce matching, then clean the data and re-run imports with proper deduplication logic.
Pro Tips
- →Configure LDAP import schedules during off-peak hours and implement delta imports using Azure AD's whenChanged attribute to reduce processing time and system impact. Set up monitoring dashboards that track import success rates and user authentication patterns to proactively identify integration issues before they affect end users.
- →Implement certificate monitoring workflows that alert administrators 30 days before SAML signing certificates expire, and maintain a certificate rotation runbook that includes both Azure AD and ServiceNow update procedures. Use ServiceNow's Scheduled Script Execution to automate certificate expiration checks and create incident records for proactive renewal.
- →Create custom business rules that log Azure AD group membership changes to audit tables for compliance reporting and access review purposes. Implement approval workflows for high-privilege role assignments that require manager approval even when automatically triggered by Azure AD group membership changes.
- →Configure Azure AD app registration with multiple redirect URIs for different ServiceNow environments (dev, test, production) but use separate client credentials for each environment to maintain proper segregation. Set up Azure AD application proxy connectors for hybrid scenarios where on-premises ServiceNow instances need secure access to cloud-based Azure AD.
- →Use ServiceNow's Integration Hub Microsoft Graph spoke actions for real-time user attribute updates instead of relying solely on scheduled LDAP imports for time-sensitive changes. Implement event-driven workflows that trigger immediate user updates when critical attributes like department or manager change in Azure AD.
- →Configure Azure AD B2B guest user policies to automatically provision external users in ServiceNow with restricted roles when they're invited to collaborate on specific projects. Set up automated cleanup processes that deactivate ServiceNow accounts when Azure AD guest accounts expire or are removed from the tenant.
Known Limitations
- —Microsoft Graph API throttling limits restrict high-volume user synchronization to 10,000 requests per 10-minute window, potentially causing delays in large organization deployments with frequent user changes. LDAP import operations are limited by domain controller performance and network latency, typically supporting batch imports of 5,000-10,000 users per hour depending on attribute complexity and MID Server resources.
- —SAML 2.0 attribute mapping is limited to static field assignments and doesn't support complex transformations or conditional logic that might be available in other identity providers. Nested Azure AD group memberships aren't automatically flattened during LDAP imports, requiring custom scripting or separate import processes to handle complex organizational hierarchies.
- —Azure AD Connect synchronization delays can cause up to 30-minute latency between on-premises Active Directory changes and availability in ServiceNow when using hybrid identity scenarios. Conditional access policies applied to ServiceNow may interfere with automated integration scripts and service account operations, requiring careful exception configuration.
- —MID Server LDAP connectivity requires persistent network connections and doesn't support dynamic port allocation or load balancing across multiple domain controllers without additional configuration. Cross-forest or multi-tenant Azure AD scenarios require separate LDAP configurations and credential management, increasing complexity for large enterprise deployments.
- —ServiceNow's native SAML implementation doesn't support advanced Azure AD features like session lifetime policies or continuous access evaluation, limiting real-time risk-based authentication capabilities. Role-based access control mapping is limited to group membership evaluation and doesn't integrate with Azure AD Privileged Identity Management just-in-time access features.
Frequently Asked Questions
Can ServiceNow integrate with both Azure AD and on-premises Active Directory simultaneously?
Yes, ServiceNow supports multiple LDAP server configurations and identity providers concurrently, allowing hybrid scenarios where some users authenticate through Azure AD SSO while others use on-premises LDAP. Configure separate data sources for each directory system and use domain-based routing or user attribute flags to determine authentication paths. The Integration Hub Microsoft Graph spoke can supplement LDAP imports with cloud-only Azure AD data, while maintaining separate credential management for each identity source.
How does Azure AD B2B guest user access work with ServiceNow integration?
Azure AD B2B guest users can authenticate to ServiceNow through SAML SSO if they're included in the application assignment, but they won't appear in LDAP imports unless explicitly synchronized to on-premises directories. Configure Azure AD guest user policies to control access levels and use conditional access to enforce additional security requirements for external users. Create separate ServiceNow groups and roles specifically for guest users with restricted permissions, and implement automated cleanup processes when guest accounts expire.
What happens to ServiceNow user sessions when Azure AD conditional access policies change?
Existing ServiceNow sessions remain active until natural expiration even when conditional access policies are updated, as SAML assertions are validated only during initial authentication. Azure AD's continuous access evaluation features aren't natively supported by ServiceNow's SAML implementation, so policy changes don't immediately affect active sessions. Consider implementing custom session validation logic that periodically checks user status against Azure AD APIs, or configure shorter session timeouts in ServiceNow to force re-authentication and policy evaluation.
How can I troubleshoot Azure AD group membership not reflecting in ServiceNow role assignments?
First, verify LDAP import logs show successful group membership data retrieval and transformation into sys_user_grmember records, checking for any filtering or attribute mapping issues. Examine business rules or scheduled jobs responsible for role assignment to ensure they're triggering correctly on group membership changes and referencing the correct group names. Use the User Administration module's group membership reports to compare Azure AD group assignments with ServiceNow group memberships, and test role assignment logic in a development instance with sample user data.
Does the Azure AD integration support ServiceNow's multi-instance architecture?
Each ServiceNow instance requires separate Azure AD app registration and SAML configuration, but you can use the same Azure AD tenant and conditional access policies across multiple instances. Configure instance-specific redirect URIs and assertion consumer service URLs in Azure AD, while maintaining centralized user and group management through shared LDAP imports. Consider using Azure AD's application proxy or custom claims rules to differentiate between development, test, and production ServiceNow environments in conditional access policies.
What are the certificate management requirements for long-term Azure AD SAML integration?
Azure AD signing certificates typically expire every three years and require proactive renewal in both Azure AD and ServiceNow to maintain SSO functionality. Monitor certificate expiration dates through Azure AD portal notifications and ServiceNow's certificate management capabilities, establishing procedures for downloading new certificates and updating identity provider configurations. Implement automated monitoring that creates ServiceNow incidents 30-60 days before certificate expiration, and maintain emergency procedures for rapid certificate updates during unplanned rotations or security incidents.
How does Azure AD Privileged Identity Management integration work with ServiceNow admin roles?
Azure AD PIM just-in-time access doesn't directly integrate with ServiceNow's role assignment system, as ServiceNow evaluates roles during session establishment rather than continuously. Consider implementing custom Integration Hub workflows that activate elevated ServiceNow roles when PIM assignments are granted in Azure AD, using Microsoft Graph API webhooks or scheduled polling to detect PIM activation events. Design approval workflows in ServiceNow that mirror PIM policies for administrative role assignments, ensuring consistent access governance across both systems.
Test Your Knowledge
Quick 3-question quiz — see how your ServiceNow skills stack up.
A list view on a table with millions of records is slow. Best fix?
Select an answer to continue