Azure AD (Entra ID) Setup#
Complete walkthrough for connecting NMP to Azure AD (Entra ID), from app registration to first successful login.
Prerequisites: Access to Azure Portal with permission to create app registrations. Familiarity with OIDC Setup.
App Registration#
In Azure Portal, go to Azure Active Directory → App registrations → New registration.
Name the application (e.g., “NMP Platform”).
Set Supported account types to your tenant configuration.
No redirect URI is needed for device flow, but setting one is good practice.
Note the Application (client) ID and Directory (tenant) ID.
Enable Device Flow#
Go to Authentication in the app registration.
Under Advanced settings, set Allow public client flows to Yes.
Save.
Expose API Scopes#
Go to Expose an API.
Set the Application ID URI (e.g.,
api://<client-id>).Add scopes:
platform:read— “Read access to NMP platform resources”platform:write— “Write access to NMP platform resources”
Go to API permissions → Add a permission → My APIs → select your app → add the scopes.
Click Grant admin consent for the scopes.
Configure Group Claims (Optional)#
Go to Token configuration → Add groups claim.
Select Security groups (or the group types your organization uses).
For the Access token, select Group ID.
NMP Configuration#
auth:
enabled: true
admin_email: "platform-admin@company.com"
oidc:
enabled: true
issuer: "https://login.microsoftonline.com/<tenant-id>/v2.0"
client_id: "<client-id>"
audience: "api://<client-id>"
# Azure AD v1 tokens may have a different issuer
additional_issuers:
- "https://sts.windows.net/<tenant-id>/"
# Azure AD uses UPN instead of email, OID for stable subject
email_claim: "upn"
subject_claim: "oid"
groups_claim: "groups"
# Azure AD prefixes custom scopes with the API URI
scope_prefix: "api://<client-id>/"
default_scopes: "openid profile email offline_access api://<client-id>/platform:read api://<client-id>/platform:write"
Verification#
nmp auth login
# Browser opens to Microsoft login page
# Sign in and consent to the requested permissions
nmp auth status
# Expected: Logged in as user@company.com, scopes: platform:read platform:write
Common Errors#
Error |
Cause |
Fix |
|---|---|---|
AADSTS70011 |
Scope not configured or no admin consent |
Add scopes in “Expose an API” and grant admin consent |
AADSTS50011 |
Reply URL mismatch |
Not typically needed for device flow; check Authentication settings |
Audience mismatch |
|
Set |
Empty email claim |
Azure AD didn’t populate |
Use |