Home / Blog / Microsoft 365 & Copilot

    Microsoft Entra ID for App Developers: Single Sign-On Done Right

    By Softworth Solutions · · 4 min read · For readers in UK, UAE, US

    Professional working on a laptop at a desk

    In short: Microsoft Entra ID single sign-on done right means four things: the correct account type in your app registration, the authorisation code flow with PKCE via MSAL, strict access-token validation on your API, and minimal permissions that tenant admins will happily approve. Get those right and users sign in once with their work account while IT keeps full control.

    Why does Entra ID SSO matter for B2B apps?

    It matters because your enterprise customers already live in Microsoft 365. Microsoft Entra ID, formerly Azure Active Directory, is the directory behind Outlook and Teams, so their staff already have accounts. Signing in with those removes passwords from your product and lets the customer's IT team apply their own MFA and Conditional Access policies.

    It also closes the leaver problem: disable someone's account and their access to your app goes with it. For UK public sector and NHS buyers, Gulf government entities and US enterprises alike, SSO is usually a procurement requirement, not a feature request.

    Key facts

    • Microsoft renamed Azure Active Directory to Microsoft Entra ID in 2023, without changing its endpoints or sign-in protocols. (Microsoft Learn)
    • Microsoft recommends the authorisation code flow with PKCE for single-page apps rather than the older implicit grant. (Microsoft identity platform documentation)
    • Microsoft runs Azure regions in the UAE, UAE North in Dubai and UAE Central in Abu Dhabi, as well as UK South and UK West. (Azure geographies)

    How should you register the application?

    Start with the supported account type, because it shapes everything else. Single tenant suits internal apps. Multi-tenant suits SaaS sold to other organisations. Adding personal Microsoft accounts only makes sense if you genuinely serve consumers, since it complicates authorisation.

    Register exact redirect URIs per environment, with no wildcards, and keep separate registrations for development, staging and production. For back ends, prefer certificates, managed identities or federated credentials over client secrets. If you must use secrets, alert on expiry. An expired secret is one of the most common causes of a sudden, total sign-in outage.

    Which OAuth flow should each app use?

    Use the standard OpenID Connect and OAuth 2.0 flow that matches the client type, and never hand-roll it. The Microsoft Authentication Library (MSAL), documented on Microsoft Learn, handles token caching, silent renewal, PKCE and consent edge cases for you.

    Matching the Entra ID flow to your app
    App typeRecommended flow
    Single-page or mobile appAuthorisation code with PKCE
    Server-rendered web appAuthorisation code with a confidential client credential
    API calling another API for a userOn-behalf-of flow
    Background service with no userClient credentials with application permissions
    Microsoft Teams tabTeams SSO token, exchanged on your back end via on-behalf-of

    Teams deserves a special mention, because its silent SSO feels magical when it works and confusing when it does not. Our guide to building Microsoft Teams apps covers how tabs, bots and message extensions fit together.

    How do you validate tokens properly?

    Your API should accept access tokens, not ID tokens, and validate each one fully: signature against Entra ID's published keys, audience matching your API, issuer, expiry and the scopes or roles needed for that operation.

    Multi-tenant apps need extra care. Each customer tenant has its own issuer, so confirm the tenant ID belongs to a customer you have actually onboarded. Otherwise anyone with a Microsoft work account can call your API. Identify users by tenant ID plus object ID, never by email.

    Hands typing on a keyboard at a clean desk

    An illustrative example

    Consider a Dubai-based property-management SaaS selling to developers across the Gulf and the UK. Its first multi-tenant release asks for broad Microsoft Graph permissions at sign-in, and several customer IT teams block it outright. The fix is modest: request only the sign-in scope up front, move calendar access to an optional admin-consent step with a plain-English explanation page, and define app roles such as Viewer and Approver. Consent requests now clear security review on the first pass.

    What permissions will tenant admins approve?

    Admins approve the smallest, clearest set of permissions you can justify. Request scopes incrementally, provide an admin consent page explaining each one, and assume many tenants block user consent entirely. For in-app authorisation, app roles are usually cleaner than group claims, because tokens only carry a limited number of groups before you must call Microsoft Graph.

    Watch for regional expectations too. UK and UAE customers increasingly ask where your app stores data, and whether it can sit in in-region cloud capacity. Have an answer ready before procurement asks.

    Key takeaways

    • Choose the account type deliberately; multi-tenant needs tenant validation on every request.
    • Use MSAL with auth code and PKCE; skip the implicit flow.
    • Validate access tokens fully and key users on tenant ID plus object ID.
    • Ask for minimal scopes and alert on expiring secrets and certificates.

    Basic single-tenant sign-in is often a few days of work; a full multi-tenant integration with admin consent, app roles and Teams SSO is more like two to four weeks. Softworth Solutions (SWS AI) builds Microsoft 365 and Teams apps where this is routine, and you can see some of our work in our case studies.

    Frequently asked questions

    Is Microsoft Entra ID the same as Azure AD?

    Yes. Microsoft renamed Azure Active Directory to Microsoft Entra ID in 2023. Endpoints and MSAL libraries are unchanged, so older Azure AD documentation still largely applies.

    Should I use SAML or OpenID Connect?

    For new apps, OpenID Connect with OAuth 2.0 is usually better because it also issues access tokens for your APIs and Microsoft Graph. SAML remains supported for older enterprise apps but only covers sign-in.

    Can my app keep data in the UAE or UK when using Entra ID?

    Entra ID handles identity, while your application data lives wherever you host it. Microsoft operates Azure regions in both the UAE and the UK, so you can deploy your app and database in-region to meet customer expectations. Check sector-specific rules with your customer and legal advisers.

    Do customers need premium licences for my app's SSO?

    Basic Entra ID sign-in works for organisations on Microsoft 365 without extra licences. Features such as Conditional Access need premium licences on the customer's side, but that is their choice, not something your app must buy.


    Planning an AI or software project? Talk to our team for a free consultation and an honest estimate.

    Previous: Progressive Web Apps vs Native Apps: Which Should You Build?
    Next: Data Readiness for AI: Cleaning, Labelling and Governing Your Data

    Keep reading