Skip to main content

Microsoft Azure SSO — Setup Guide for Emgage HRMS

Audience: Client IT / Azure administrator and Emgage HR administrator
Purpose: Enable employees to sign in to Emgage using their existing Microsoft (Azure Entra ID) account
Reference: Ticket 50054 — verified end-to-end on the Emgage Azure environment


1. What You Will Achieve​

After this setup, an employee opens Emgage, clicks Login with Microsoft, signs in with the company Microsoft account they already use for Outlook/Teams, and lands directly in Emgage. No separate Emgage password is required.

Time required: About 20 minutes

You Will Need​

RoleAccess Needed
Azure administratorPermission to create an App Registration in the company's Azure tenant
Emgage administratorAccess to Configuration → Integration → SSO Setup in Emgage

Keep both screens open side by side. You will copy values back and forth between them.


2. How It Works​

Emgage never sees the employee's Microsoft password. Microsoft verifies the employee and then tells Emgage who just signed in. Emgage matches that person to an employee record and creates the session.

Login Journey​

  1. Employee clicks Login with Microsoft in Emgage.
  2. Browser goes to the Microsoft sign-in page.
  3. Employee signs in, including MFA if the company enforces it.
  4. Microsoft sends a one-time code back to Emgage at a pre-agreed address — the Redirect URI.
  5. Emgage exchanges that code, using the Client ID and Client Secret, for the employee's identity details.
  6. Emgage matches the identity to an employee record.
  7. Match found → employee is signed in. No match → login is refused.

2.1 Two Redirect URIs — The Single Most Important Point​

Emgage uses two addresses, and both must be registered in Azure:

#Redirect URIRegistered in Azure asUsed by
1.../sso<N>/login/oauth2/code/<CompanyName>WebEveryday employee login
2.../configuration/sso-test-callbackSingle-page applicationThe Verify button in Emgage

If only one is registered, one of the two will fail. Emgage will prompt you for the second one at the right moment (Step 7), so simply follow the order in this guide.


3. Step 1 — Create the App Registration in Azure​

Go to https://portal.azure.com and sign in with an administrator account.

  1. In the top search bar, type App registrations and open it.
  2. Click + New registration. registration
  3. Name: Enter something recognisable, for example Emgage SSO Application.
  4. Supported account types: Leave Single tenant (Accounts in this organizational directory only).
  5. Leave Redirect URI empty for now — it is added in Step 6.
  6. Click Register. register

The application Overview page opens. Every value in the next steps is collected from this page.


4. Step 2 — Client ID​

On the Overview page, copy Application (client) ID.

application

In Emgage, open:

Configuration → Integration → SSO Setup → Microsoft Azure AD

Paste the Application (client) ID into Client ID.

client_id

Important: Application (client) ID in Azure = Client ID in Emgage. They are the same value under two different names.


5. Step 3 — Client Secret​

  1. On the Overview page, click Client credentials (shown as 0 certificate, 1 secret). credentials
  2. On the Certificates & secrets page, click + New client secret.
  3. Give it a description and select an expiry period.
  4. Click Add.
  5. Copy the Value column immediately. secret_id

Important: Copy the Value, not the Secret ID. The Value is shown only once. Once you navigate away it is hidden forever and you must create a new secret.

Paste the secret into Client Secret in Emgage.

Client Secret Expiry​

Note the expiry date. When the secret expires, SSO stops working for everyone. Create a new secret and update Emgage before that date.


6. Step 4 — Endpoints and Tenant ID​

  1. On the Azure Overview page, click Endpoints in the top toolbar.The Directory (tenant) ID is on the same page. endpoints
  2. In the Endpoints panel, use the OAuth 2.0 endpoints marked (v2) — not the (v1) ones. endpoints2
  3. Enter the following values in Emgage, replacing <TENANT_ID> with your Directory (tenant) ID.
Emgage FieldValue
Scopesopenid,email,profile
Authorization URIhttps://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/authorize
Token URIhttps://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/token
User Info URIhttps://graph.microsoft.com/oidc/userinfo
JWK Set URIhttps://login.microsoftonline.com/<TENANT_ID>/discovery/v2.0/keys

Using your Tenant ID instead of common restricts sign-in to your own organisation's accounts. This is the recommended setting.


7. Step 5 — Decide How Employees Are Matched​

Microsoft confirms who signed in. Emgage still has to find the matching employee record.

Three fields control this:

Emgage FieldWhat It Means
Username AttributeThe unique identifier Emgage reads from Microsoft's response. For Azure, use sub.
Attribute NameThe field whose value is matched against the employee record.
Attribute MappingWhat that value is matched against — Email or Employee ID.

Choose one of the three options below.

Option A — Microsoft Username Is the Same as the Employee's Official Email​

Use this when the employee's Microsoft sign-in name already equals the Official E-mail ID on their Emgage profile.

FieldValue
Username Attributesub
Attribute Namepreferred_username
Attribute MappingEmail

The Official E-mail ID lives on the employee's Emgage profile. option_a

Option B — A Different Email Address Should Be Used​

Use this when the employee's Microsoft sign-in name is not the address you want to match on.

  1. In Azure, search for Users, open the employee, and click Edit properties. option_b
  2. Open the Contact Information tab.
  3. Set Email to the address that will be matched.
  4. Click Save. option_b_2
  5. The same address must be the Official E-mail ID on the employee's Emgage profile.
FieldValue
Username Attributesub
Attribute Nameemail
Attribute MappingEmail

Option C — Match on Employee ID Instead of Email​

Use this when employee codes are the reliable identifier rather than email.

This option needs three extra steps first. Microsoft does not send the employee ID to Emgage by default. You must store it on the user, publish it as a claim, and switch on mapped claims for the application.

Skipping any of the three makes verification fail with:

Attribute "employeeid" not present

C1 — Store the Employee ID on the Azure User​

  1. In Azure, open the user → Edit properties → Job Information tab.
  2. Set Employee ID to exactly the employee code used in Emgage.
  3. Click Save. option_c

C2 — Publish the Employee ID as a Claim​

  1. Go to https://entra.microsoft.com and open Enterprise applications → All applications, Open the application you registered. c2
  2. Open Single sign-on. c2_1
  3. Under Attributes & Claims, click Edit. then Click + Add new claim. c2_2
  4. Fill in the claim as follows:
FieldValue
Nameemployeeid
NamespaceLeave empty
SourceAttribute
Source attributeuser.employeeid

c2_3

Important: The Name you enter here is exactly what goes in Emgage's Attribute Name field later. Keep it lowercase — employeeid — and type it identically in both places.

C3 — Allow Mapped Claims in the Application Manifest​

  1. Go to App registrations, Open the same application and Select Manifest. c3_1

  2. On the Microsoft Graph App Manifest (New) tab, find acceptMappedClaims, Change its value from null to true, Click Save. c3_2

Without acceptMappedClaims: true, Microsoft accepts the claim configuration but refuses to send the value, and Emgage sees nothing.

C4 — Enter the Values in Emgage​

Return to https://portal.azure.com for the remaining steps, and set these values in Emgage:

FieldValue
Username Attributesub
Attribute Nameemployeeid
Attribute MappingEmployee Id

Important: Whichever option you choose, the value in Azure and the value in Emgage must match exactly — same spelling, same case, no extra spaces. A mismatch is the most common reason a single employee cannot log in while everyone else can.


8. Step 6 — Register the Web Redirect URI​

  1. In Emgage, the Redirect URI field is filled in automatically and cannot be edited. Click the copy icon next to it. redirect_url

  2. In Azure, from the Overview page open Redirect URIs. azure

  3. Click + Add Redirect URI. add_redirect_url

  4. Choose the Web platform. web

  5. Paste the copied URI and click Configure. Configure

Important: Paste it exactly as copied — no trailing slash and no changed capitalisation. Azure requires a character-for-character match.


9. Step 7 — Verify and Save​

  1. Back in Emgage, confirm the attribute fields from Step 5 are set. confirm

  2. Click Verify & Save. save

  3. A Warning dialog appears showing a second Redirect URI — the test callback address. Copy it. warning

  4. Go back to Azure → Add Redirect URI. azure

  5. This time choose Single-page application, paste the copied URI.and click Configure. image

  6. Return to Emgage and click Verify Now.

  7. A Microsoft sign-in window opens. Sign in with a real employee account that exists in both Azure and Emgage.

Successful Verification​

On success:

  • A confirmation message appears.
  • The configuration is saved automatically.
  • The status changes to Active.
  • SSO is now live.

Failed Verification​

On failure:

  • The exact reason is shown on screen.
  • Nothing is saved.
  • See the troubleshooting section below.

10. Step 8 — Confirm It Works​

#CheckExpected Result
1SSO Setup statusShows Active
2Employee clicks Login with MicrosoftSigns in and reaches the dashboard
3Employee present in Azure but not in EmgageLogin refused with a clear message
4Log out, then log in againWorks without re-entering configuration

11. Troubleshooting​

Message or SymptomCauseWhat to Do
AADSTS50011 — redirect URI mismatchThe URI in Azure does not exactly match the one in EmgageRe-copy the URI from Emgage and paste it again. Check for a trailing slash or http vs https.
Verify works, but employee login failsOnly the Single-page application URI was registeredAdd the Web platform URI as well (Step 6).
Employee login works, but Verify failsOnly the Web URI was registeredAdd the Single-page application URI as well (Step 7).
Username Attribute "…" not presentThe attribute is not returned by MicrosoftSet Username Attribute to sub.
Attribute "employeeid" not presentThe claim was never published, or mapped claims are offComplete steps C2 and C3 — add the employee ID claim and set acceptMappedClaims to true.
Employee Id option verifies, but one employee cannot log inTheir Employee ID in Azure is blank or differs from EmgageSet it under Edit properties → Job Information to match the Emgage code exactly.
Attribute "…" found but value is "…"The attribute holds neither an email nor a yes/true valuePoint Attribute Name at preferred_username or email (Step 5).
One employee cannot log in, everyone else canTheir Azure value and Emgage value do not matchCompare the Azure email / Employee ID against the Emgage profile, character for character.
Worked before, suddenly stopped for everyoneThe client secret expiredCreate a new secret in Azure, paste the new Value into Emgage, and click Verify & Save.
Sign-in blocked by your organisationAdmin consent not grantedAzure → the app → API permissions → Grant admin consent.

12. Ongoing Maintenance​

ItemAction
Client secretNote the expiry date and renew before it lapses — SSO stops for all users the moment it expires.
New employeesEnsure the Official E-mail ID (or Employee ID) on the Emgage profile matches Azure.
Employee email changesUpdate it in both Azure and Emgage, or that employee will lose SSO access.
Client secret handlingTreat it like a password — share only through a secure channel, never by plain email.

13. Quick Reference​

Emgage FieldWhere It Comes From in Azure
Client IDOverview → Application (client) ID
Client SecretCertificates & secrets → New client secret → Value
Scopesopenid,email,profile
Authorization URIhttps://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/authorize
Token URIhttps://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/token
User Info URIhttps://graph.microsoft.com/oidc/userinfo
JWK Set URIhttps://login.microsoftonline.com/<TENANT_ID>/discovery/v2.0/keys
Username Attributesub
Attribute Namepreferred_username, email, or employeeid
Attribute MappingEmail or Employee Id
Employee ID claimEntra → Enterprise applications → Single sign-on → Attributes & Claims
acceptMappedClaimsApp registrations → Manifest → set to true (Employee Id only)
Redirect URI (Web)Copied from Emgage → registered in Azure
Redirect URI (SPA)Shown by Emgage on Verify & Save → registered in Azure

Important Security Notes​

  • Treat the Client Secret like a password.
  • Never share the Client Secret through plain email.
  • Copy the Client Secret Value immediately when it is created because it is shown only once.
  • Monitor the Client Secret expiry date and renew it before expiry.
  • Ensure employee matching values in Azure and Emgage are identical.

Was this page helpful?