Introduction to Entra ID multi-tenant applications

When building a Software as a Service (SaaS) or any application that serves multiple organisations, you often need a single identity platform to handle authentication and authorisation on behalf of each customer. Entra ID (formerly Azure Active Directory) allows you to register a single application in a “home” tenant, which can be accessed by users from multiple “remote” or “guest” tenants.

In a multi-tenant scenario, the application is registered in one tenant (the “publisher” or “provider” tenant), but users and admins from various other tenants (the “consumer” or “customer” tenants) can consent to the application’s permissions or install the app in their own directory.

Delegated permissions vs. application permissions

Before exploring credential options and multi-tenancy, it’s important to distinguish between delegated permissions and application permissions.

Many multi-tenant applications need both delegated and application permissions: user-driven interactions at the front end, and automated background jobs at the back end.

Multi-tenant registration patterns

When you register a multi-tenant application in Entra ID:

  1. Register in your home tenant
    Create an app registration in your “publisher/provider” tenant. In the Azure portal under “Authentication,” ensure “Accounts in any organisational directory (Any Azure AD directory)” is selected to permit remote tenants to sign in.

  2. Consent from each remote tenant
    Each customer or remote tenant must grant permission for your application. Admin consent is required for higher-privilege permissions (either via an admin consent URL or directly in the Azure portal).

  3. Token issuance
    Once consented, remote users sign into your application and receive tokens referencing your app registration from the home tenant. Make sure to validate tokens carefully and handle any tenant-specific logic.

Credential options

Client secrets

What is it?
A client secret is a string shared between Entra ID and your application. Your app uses this secret to request tokens in confidential flows.

Pros

Cons

Where to use

Certificates

What is it?
An X.509 certificate can replace the client secret, with the public key uploaded into Entra ID. Your application holds the private key securely (e.g., in Azure Key Vault).

Pros

Cons

Where to use

Managed identities

What is it?
Managed identities are automatically managed by Azure for Azure resources, removing the need to store secrets or certificates. Your app can request tokens from Entra ID without manual credential management.

Pros

Cons

Where to use

Workload identity federation

What is it?
Workload identity federation allows external identity providers (like GitHub Actions or Kubernetes) to exchange their tokens for Entra ID tokens, eliminating the need for stored secrets. This trust relationship is configured in Entra ID.

Pros

Cons

Where to use

Entra ID’s consent model manages permissions in each remote tenant. Depending on the permission type:

Ensure you clearly communicate the admin consent process to remote tenant administrators, especially when your application requests broad scopes.

Assigning permissions across tenants

  1. Guide admins for admin consent
    Provide an admin consent URL or portal instructions so remote tenant admins can grant your requested permissions. Admin consent is essential for application permissions or any elevated delegated scopes.

  2. Use tenant-specific tokens
    When calling Microsoft Graph or your own resource APIs, request tokens from the relevant tenant’s authority (e.g. https://login.microsoftonline.com/<tenant_id>). Always validate the tenant ID and permission claims in returned tokens.

  3. Track consent status
    Keep a record of which tenants have granted which permissions. This audit trail is crucial for compliance and support, particularly if an admin needs to review or revoke access.

Best practices and considerations

Conclusion

By designing your Entra ID multi-tenant application to address delegated and application permissions, and carefully choosing the right authentication method (secrets, certificates, managed identities, or workload identity federation), you can ensure a secure and seamless experience for all your customers. A well-planned consent strategy, coupled with strong security measures, enables your application to operate effectively across many remote tenants while maintaining rigorous standards of compliance and data protection.

Further reading

Comments

Add a comment
Loading...
Follow
Follow