Connecting Microsoft 365

This page is for an organization's administrators. Connecting lets Empeiro bring in eligible people from your Microsoft 365 directory with their name, job title, department and photo, keep them up to date, decide who answers tickets from a security group, and let people sign in with their work account. The directory connection does not read anyone's email, and Empeiro writes nothing to Microsoft 365. Tickets, messages and the knowledge base live in Empeiro.

You connect with an app registration you make in your own Microsoft 365. Empeiro has no app of its own in your tenant and never registers anything there; you create it, you can see everything it may do, and you can delete it at any time.

Before you start

Important: Save and test starts a real employee directory import when the test passes. It is not a preview. Complete the preparation below before selecting it. For the current rollout, wait for the operator's security-release clearance before that step.

This connection uses Microsoft Entra ID, the cloud directory for your Microsoft 365 tenant (formerly Azure Active Directory). It does not connect directly to an office domain controller. In a hybrid environment, first confirm that the intended employees are present and enabled in Entra ID.

Step 1: create the app registration in Microsoft

This gives Empeiro an identity in your Microsoft 365 and tells Microsoft what it may read.

  1. Sign in to the Microsoft Entra admin center at https://entra.microsoft.com as a Global Administrator. Check the directory name in the portal before continuing. For the firm's own help desk, use the firm's tenant. Each customer makes this registration in its own tenant and enters it in its own Empeiro organization.

  2. In the left menu go to Entra ID → App registrations and click New registration. (In older menus the path is Identity → Applications → App registrations.)

  3. Fill in the form:

    • Name: Empeiro
    • Supported account types: Single tenant only (older wording: Accounts in this organizational directory only).
    • Redirect URI: for employee Microsoft sign-in, choose Web and enter https://empeiro.app/api/auth/microsoft/callback. For a different installation, copy its exact URI from Microsoft 365 ? Sign in with a work account. Directory-only use does not need a callback; configuring it now prepares SSO correctly.
    • Click Register.
  4. You land on the app's Overview page. Two values here go into Empeiro; copy them somewhere safe:

    • Application (client) ID, a value like aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
    • Directory (tenant) ID, the same shape
  5. In the left menu of the app, open API permissions. The list already shows one row, User.Read of type Delegated: Microsoft adds that to every new registration. Leave it there. Now click Add a permission, choose Microsoft Graph, then the Application permissions box (the one on the right, not Delegated). In the search box find and tick:

    • User.Read.All: reads people's profiles and photos.
    • GroupMember.Read.All: reads which security groups people are in, so you can choose a group whose members are agents. Harmless if you mark agents by hand.
    • Organization.Read.All: reads the tenant name, verified domains and license information. Include it for employee single sign-on: without verified-domain discovery, directory sync can succeed but work-account email routing is unavailable. Microsoft lists the organization API application permissions.

    Click Add permissions.

  6. Still on API permissions, click Grant admin consent for (your organization) and confirm. The Status column should show a green tick and Granted for … on every row, the delegated one included. Without this step Empeiro is refused.

  7. Open Certificates & secrets, then Client secrets → New client secret. Give it a description such as Empeiro and choose the expiry offered by your tenant's policy. Record a replacement reminder before that date. Click Add.

  8. Copy the secret's Value immediately. It is shown only once. Do not copy the Secret ID beside it; that is a different thing and will not work.

Prepare work-account sign-in

Verify the callback before inviting employees to sign in with Microsoft. If you entered it when creating the registration in Step 1, it is already registered: do not add it again.

  1. In the same Empeiro app registration, open Authentication.
  2. Under Redirect URI configuration, expand Web and look for https://empeiro.app/api/auth/microsoft/callback. For another installation, compare with the exact redirect URI shown by its Microsoft 365 page, including its hostname and path. If it is already listed under Web, this part is complete. Close any Add Redirect URI pane with Cancel and continue to step 4.
  3. Only if the callback is missing, select Add Redirect URI (older portal: Add a platform), choose Web, enter the callback once, and select Configure or Save. The expected result is one matching entry under Web. Empeiro handles the authorization code on its server; this callback belongs under Web even though Empeiro also has a browser interface. See Microsoft's platform configuration instructions.
  4. Leave the implicit-grant Access tokens and ID tokens checkboxes unticked; this connection uses the authorization-code flow. In the Authentication preview, these controls are on the Settings tab. No second callback is required for directory sync or for linking your Microsoft account.
  5. Review Sign in with a work account for verification and linking an existing administrator account.

Which permissions are required, and why

These are application permissions: Empeiro reads the directory in the background without an employee being present. They are separate from the openid profile email scopes requested when an employee signs in. Selecting only a delegated User.Read.All row does not authorize hourly sync. Microsoft explains the two permission types.

Permission Empeiro operation If omitted
User.Read.All (application) Read directory people, their eligibility/profile fields and available photos The directory test/sync cannot operate. Required for this connection.
GroupMember.Read.All (application) Read named security-group membership, including nested membership, for agent selection Manual agent selection works; group-based selection cannot reliably update. The interface reports missing group access.
Organization.Read.All (application) Read the tenant's name, Microsoft-verified domains and subscribed license names Directory sync may work, but email-based SSO routing needs verified domains. License-name filtering may be less precise. Include it for SSO.
openid, profile, email (interactive sign-in scopes) Return the signed-in identity to Empeiro Work-account sign-in cannot complete without the necessary interactive consent. These scopes do not authorize tenant-wide directory work.

The User.Read delegated row that the registration starts with is not Empeiro's directory-sync permission. No Mail.Read, Mail.Send, mailbox access, or calendar access is required by this setup. Do not add permissions merely because another application uses them. A permission can appear on the registration before consent is granted; verify the Granted for… status as well.

Official endpoint references: List users, transitive memberships, photos, and license names.

Step 2: enter the details in Empeiro

  1. In Empeiro, open Microsoft 365 in the menu on the left (administrators only).
  2. Paste the three values:
    • Directory (tenant) ID → from the Overview page
    • Application (client) ID → from the Overview page
    • Client secret → the Value from step 8
  3. Check that both IDs came from the same registration in the intended tenant. After the security release is cleared, click Save and test. A successful test immediately runs the first real directory sync.

Settings → Microsoft 365 before connecting: what connecting does, the three boxes for the Directory (tenant) ID, Application (client) ID and client secret, Save and test, and the steps to create the app registration

The steps sit right under the form; Full guide opens this page.

Empeiro stores the secret encrypted and never shows it again, only its last four characters. The form checks the two IDs look right before sending anything, then signs in to Microsoft with your registration and reads one person to prove the permissions work.

If the light turns green ("Test passed"), the first sync starts automatically. If it turns red, the message says what is wrong in plain words; see the table below, fix it, and the form stays open for corrections.

Microsoft 365 connected: the green light with the organization's name, how many people, when it last synced, the accounts left out with Include, Test and Sync now, and the app registration line with Change details

Connected: everything about the connection on one page.

What syncing does

Every save, test and sync is written to the Recent activity list at the bottom of the page, with who did it; the whole log is Activity.

Who answers tickets

Beside the sync, Who answers tickets chooses a security group whose members are agents (an IT team, say), with anyone you mark as Agent by hand in the people list. Everyone else from the directory is a requester. Change the group's members in Microsoft 365 and Empeiro follows on the next sync. "Only people marked by hand" uses no group at all.

Groups that aren't security groups (a Microsoft 365 group for a team's mail, say) aren't offered.

Who can sign in

Connecting does not open Empeiro to the whole staff. Only these people uses one authoritative sign-in list for invited accounts and directory people. Invitations add people to the list automatically, and an administrator can untick them. Organization administrators are always allowed; an invited nonadministrator has no separate bypass.

Select Save who can sign in after changing the scope or checkboxes. Read Not saved yet as a reminder that the selection is pending. Removing a nonadministrator from the saved list revokes their access, including existing sign-ins and live connections. Administrators must have their administrator role changed separately by another administrator before the list can restrict them.

Verify with a pilot employee before rollout

  1. Confirm the connection is green and read the latest successful sync summary. Inspect several actual employees for the correct name, email and department.
  2. Open accounts left out. An unlicensed employee may be excluded by the default license rule; choose Include for a real employee who should have access. Guests, disabled accounts and entries without email are not the same as excluded enabled employees.
  3. Keep Only these people selected initially. Add the authorized pilot employee and save the sign-in list.
  4. Ask that employee to use a separate browser session: Sign in → Use your work account (Microsoft 365) → work email → Microsoft sign-in.
  5. Confirm they land in the correct organization as a requester, can create a real agreed pilot ticket and can exchange a reply with IT Support. Check the ticket from the agent side too.
  6. Have the existing administrator use Link your Microsoft account from Your account to retain one account for both sign-in methods.
  7. When the pilot passes, select Everyone in the directory if the whole synced staff should submit tickets, and save. Imported employees remain requesters unless you explicitly grant support or administrator privileges.

Completion check: employees come from the intended real tenant, the included staff can sign in, a requester can submit a ticket, and IT Support can receive and answer it. A green connection test alone does not establish all four outcomes.

Microsoft reference documentation

These official references explain the Microsoft-side controls used above:

Who can sign in beside the sync: Only these people with the count, Everyone in the directory, Save who can sign in, and the people list with Can sign in and Agent beside each person

The pilot: start with a few people, then everyone.

Verified domains and tenant ownership

Work-account routing accepts only domains returned by Microsoft as verified for this tenant. A person's email suffix alone does not claim a domain. The same tenant and verified domain cannot be claimed by two Empeiro organizations. If an intended email domain is missing, verify it in the correct Microsoft tenant and grant Organization.Read.All, then run Test or Sync now. Do not change an employee's address or create a replacement organization to bypass an ownership conflict. Ask support to resolve a legitimate tenant transfer.

Keeping it working

What automatic synchronization does and does not promise

The hourly interval runs in the application server, not your browser or a laptop scheduled task. The server must be running and its background sweep enabled. Each directory run follows all pages; it is a full read, not a Microsoft delta-query subscription. Microsoft directory changes can take time to appear, and the agent security-group query uses eventual consistency.

Guest, disabled and no-email accounts are rejected before inclusion decisions. Include can override an unlicensed/device exclusion, but cannot turn a guest or disabled account into an eligible member. If license names cannot be retrieved, unknown licensed SKUs are not guessed to be device licenses; review included accounts and manually leave out any inappropriate identities. Member eligibility uses Microsoft's mail value, not a guessed mailbox address from its UPN.

A failed complete directory read does not replace the existing directory with a partial page. Photo/group failures can leave the previous photo/group data in place; the sync message reports those exceptions. A connection in error is not automatically retried by directory sync until an administrator fixes it and selects Test or Sync now.

Directory removal/exclusion takes effect after a successful sync. Microsoft sessions for identities no longer synchronized are then rejected. A separately invited native account remains separately managed by the organization's administrators; remove its account or access when appropriate. Do not treat a failed sync, a Microsoft account disable, or the one-hour timer as instant universal revocation of every independent Empeiro password/passkey account.

Renew a secret without disrupting access

  1. Record the current registration's IDs and the existing secret's expiry in your password manager.
  2. Before expiry, create a replacement under Certificates & secrets → Client secrets. Keep the old credential valid while testing the replacement, where your tenant policy allows overlap.
  3. In this same Empeiro organization, select Change details, keep tenant/client IDs, paste the new Value, and select Save and test. This performs the normal first-sync behavior again.
  4. Check directory status and the resulting people count, then complete a work-account sign-in.
  5. Only then remove the old secret from Entra. Deleting an old secret in Entra is not done by Empeiro's form. Never paste the credential into Activity, a support ticket, or a screenshot.

Microsoft recommends certificate credentials for production and a client-secret lifetime below 12 months; tenant policy may be stricter. Empeiro currently supports encrypted client secrets, not certificate uploads or federated workload credentials. See Microsoft's credential guidance.

Continue through employee access

For a complete customer setup, follow this order:

  1. Register the app, set its Web callback for SSO, configure permissions and consent.
  2. Save/test/sync in the correct customer organization and review included/excluded people.
  3. Choose agents and the sign-in list; link the existing administrator's Microsoft identity.
  4. Test a listed employee's Microsoft sign-in and confirm an unlisted employee is refused.
  5. If you are bringing in ticket history, export it to CSV and follow Importing existing records: preview first, then import.
  6. Record credential renewal, source sync checks and offboarding exports in your admin procedure.

The red light after a secret expired, with Microsoft's reason in plain words

When something is wrong, the light says what.

Messages and what to do

Message Cause What to do
This should look like 00000000-0000-… An ID was pasted incompletely or with extra text. Copy the ID again from the app's Overview page.
Enter the client secret (the Value from Certificates & secrets) The secret box was empty on a first save. Paste the secret's Value.
Microsoft rejected Empeiro's app secret. It may have expired. Wrong secret, or the Secret ID instead of the Value. Make a new client secret and paste its Value.
Microsoft rejected Empeiro's app secret: it has expired. The secret's expiry date has passed. Make a new client secret, Change details, paste its Value.
Empeiro's app isn't known in this organization. Check the Application (client) ID, and that an administrator has granted consent. The client ID is wrong, or the registration is in a different tenant. Check the Application (client) ID and the Directory (tenant) ID come from the same app's Overview page.
Microsoft doesn't recognize this organization (tenant). Check the Directory (tenant) ID. The tenant ID is wrong. Copy the Directory (tenant) ID from the Overview page.
Empeiro isn't allowed to read the directory. An administrator needs to grant consent. Permissions were added but Grant admin consent was not clicked, or Delegated permissions were chosen instead of Application. On API permissions, check the type says Application and click Grant admin consent.
Security groups couldn't be read (the GroupMember.Read.All permission isn't granted)… Only User.Read.All was granted. People and photos still sync. Add GroupMember.Read.All, grant consent, Sync now. Only matters if agents follow a security group.
Group membership couldn't be read for N people and was left as it was. Microsoft throttled or had a passing error. Nothing; the next sync retries. Known groups were kept.
N photo(s) couldn't be read and were left as they were. A passing error, or a mailbox on an on-premises server. Nothing; the next sync retries.
A stored secret couldn't be read with this server's key (the server may have been restored or moved). Enter the client secret again. The server's encryption key changed, usually after a restore onto a new server. Click Change details, paste the client secret's Value again, Save and test.
This server can't store a client secret… A fault on Empeiro's side. Contact support; nothing on your side needs changing.
The directory couldn't be reached: … A network problem between the server and Microsoft. Try Test again in a few minutes.
That Microsoft 365 tenant is already connected to another organization on Empeiro. One tenant connects to one organization. Contact support if this tenant should move.
← Adding an organization