Microsoft Entra Integration
Integrate Digital ID with Microsoft Entra ID (Azure AD) for single sign-on and employee synchronisation.
Overview
Microsoft Entra integration provides:
- Single Sign-On (SSO): Users can log in with their Microsoft 365 accounts
- Employee Synchronisation: Automatically sync employees from Microsoft 365
- Seamless Integration: Works with existing Office 365 infrastructure
Prerequisites
- Microsoft 365 subscription with Azure AD
- Admin access to Azure AD
- Ability to register applications in Azure AD
Setting Up Entra Integration
Step 1: Register Application in Azure AD
- Log in to the Azure Portal
- Go to "Azure Active Directory" → "App registrations"
- Click "New registration"
- Enter application name: "Digital ID"
- Set redirect URI:
https://lightslategrey-weasel-963972.hostingersite.com/entra-login.php - Click "Register"
Step 2: Configure API Permissions
- In your app registration, go to "API permissions"
- Click "Add a permission"
- Select "Microsoft Graph"
- Add the following permissions:
- For SSO Login (Delegated Permissions):
User.Read- Read user profileopenid- Sign in and read user profileprofile- View user's basic profileemail- View user's email address
- For User Synchronisation (Application Permissions):
User.Read.All- Read all users' profiles (requires admin consent)
- For SSO Login (Delegated Permissions):
- Click "Add permissions"
- Important: For
User.Read.All, click "Grant admin consent" to enable user synchronisation
Step 3: Create Client Secret
- Go to "Certificates & secrets"
- Click "New client secret"
- Enter description and expiration
- Click "Add"
- Copy the secret value immediately - you won't be able to see it again
Step 4: Configure in Digital ID
- Log in as organisation administrator
- Go to "Entra Settings" in the admin menu
- Enter your Tenant ID (found in Azure AD overview)
- Enter your Client ID (Application ID from app registration)
- Enter your Client Secret (from Step 3)
- Enable the integration
- Save settings
Security
Keep your Client Secret secure. Never share it or commit it to version control. Store it in your environment variables.
Using Entra Login
Once configured, users can log in with Microsoft:
- Go to the login page
- Click "Sign in with Microsoft"
- Authenticate with Microsoft 365 credentials
- You'll be redirected back to Digital ID
User Synchronisation
When Microsoft Entra integration is enabled, organisation administrators can synchronise users from Microsoft 365:
- Bulk Import: Fetch all active users from Microsoft Entra ID
- Automatic Matching: Users are matched by email address
- Create or Update: New users are created, existing users are updated
- Employee Profiles: Optionally create employee profiles for users with employee IDs
- Same Process: Uses the same import logic as CSV/JSON import for consistency
How to Sync Users
- Go to Organisation → Microsoft 365 SSO Settings
- Ensure Entra integration is enabled
- Click "Sync Users from Microsoft Entra ID"
- Optionally check "Also create employee profiles" if users have employee IDs
- Review the sync results and any warnings
Required Permissions
For user synchronisation to work, your Azure AD app registration needs User.Read.All application permission (not delegated). Admin consent is required for this permission.
Benefits
User synchronisation automates the import process by pulling data directly from Microsoft Entra ID, eliminating the need to export CSV files manually. It uses the same reliable import system as manual CSV/JSON imports.
Troubleshooting
Common Issues
- Redirect URI mismatch: Ensure the redirect URI in Azure AD matches exactly
- Permissions not granted: Admin consent may be required for API permissions
- Invalid client secret: Check that the secret hasn't expired
- Tenant ID incorrect: Verify the Tenant ID in Azure AD overview