Automated pull-based identity synchronization. Your application authenticates directly to the Microsoft Graph REST API as itself (machine-to-machine) and imports targeted users from Microsoft Entra ID using OData inclusion filters. This page executes and reveals every step of the query and ingestion pipeline.
In a pull architecture, the client application controls when to synchronize, which identities to query, and how to ingest them into its local database. Here is the complete protocol lifecycle:
/oauth2/v2.0/token)
using its registered Application (Client) ID and Client Secret.
/.default):
The app requests scope https://graph.microsoft.com/.default. Microsoft Entra returns an Access
Token containing tenant-wide Application Roles (such as User.Read.All) that have
been pre-approved by a directory administrator via Admin Consent.
$filter) to select only active, relevant employees (e.g.,
department eq 'Sales' and accountEnabled eq true).
ConsistencyLevel: eventual):
Standard queries are strictly consistent. However, advanced filters (such as ne,
endsWith, or searching custom directory extensions) leverage Entra's distributed indexing layer.
Microsoft Graph requires passing the ConsistencyLevel: eventual header and $count=true.
@odata.nextLink):
Graph returns matching users in pages (default 100). If more users match, Graph provides an opaque cursor URL
(@odata.nextLink). The application loops through these pages to import and reconcile all identities
in its local store.
Obtain credentials from your Microsoft Entra App Registration. These identify and authorize your application to read the directory. Secrets are transmitted only to the local backend proxy to perform the token exchange and are never persisted in the browser.
contoso.onmicrosoft.com).v1.0 is recommended for production; beta provides preview properties.
Execute a machine-to-machine token exchange against the Entra OAuth2 v2.0 token endpoint.
The requested scope https://graph.microsoft.com/.default instructs Entra to include all
Application permissions statically consented to the app. Inspect the decoded JWT below to verify the
roles claim.
// Fill in config above to preview
// Awaiting request…
Define criteria to select which users to import. Multiple conditions are automatically combined using and.
If no conditions are set, all directory users will be pulled.
Advanced queries (using ne, endsWith, or on-premises extension attributes)
automatically attach the required ConsistencyLevel: eventual header.
The exact HTTP GET request that will be sent to the Microsoft Graph REST API. Notice the bearer token authorization,
the OData query parameters, and the ConsistencyLevel header.
The raw response from Microsoft Graph and the resulting directory user table. In a production sync engine, these user records are reconciled and inserted into the local application database.
// Will appear after pulling users
// Awaiting request…