Exchange application authorization

Exchange Online SMTP OAuth with least-privilege Application RBAC

A certificate proves which application requests a token; Exchange Application RBAC determines which sender mailboxes that application may use. Keeping those boundaries separate prevents a narrow SMTP integration from becoming tenant-wide mail authority.

A certificate-backed application passes through a scoped authorization gate to one highlighted sender mailbox while other mailboxes remain outside the permitted boundary.
Application identity and Exchange sender authorization are separate controls; the effective scope should include only the intended mailbox.View full-size illustration

Public RC note RelayBridge v1.0.0-rc.1 is available as an unsigned pre-release for evaluation and community testing. It is not the signed stable release. Check release status.

Last technically verified

Immediate answer

Authenticate the application, then authorize only the sender it needs.

Exchange Application RBAC can grant an application the Application SMTP.SendAsApp role through a management role assignment paired with a resource scope. The scope defines which Exchange recipients the application is authorized to use.

This model is independent of broad application permissions granted through Microsoft Entra. Microsoft documents App RBAC as the replacement for Application Access Policies and warns that Entra application grants and Exchange RBAC grants are additive. A broad Entra grant can therefore defeat the intended narrow Exchange scope.

Authorization model

Token, protocol, and sender answer different questions.

BoundaryQuestion answeredTypical evidence
Entra application identityWhich software is requesting the token?Tenant, client ID, service principal, and certificate-backed client assertion
Exchange application roleWhat Exchange operation may the application perform?Application SMTP.SendAsApp role assignment
Resource scopeWhich sender mailbox is inside that authority?Management scope and effective authorization test

XOAUTH2 transports the resulting OAuth bearer token inside the SMTP authentication exchange. It does not create mailbox permission by itself, and a certificate uploaded to the app registration does not authorize any sender by itself.

Do not mix models

Microsoft documents two app-only authorization patterns.

Application permission plus mailbox permission

The application receives the Exchange Online SMTP.SendAsApp application permission with admin consent, is registered as an Exchange service principal, and receives the required sender mailbox permission.

Exchange Application RBAC

The app is linked into Exchange, receives the Application SMTP.SendAsApp management role, and is constrained by a resource scope. Microsoft's SMTP App RBAC onboarding guidance says not to add the Entra SMTP permission for this model.

Additive permissions

Do not assume a narrow RBAC assignment overrides a broad Entra application permission. Review and remove unnecessary grants through controlled change management after confirming the intended model and all consumers.

Identifier discipline

The application ID and service-principal object ID are not interchangeable.

The Entra app registration has an application—or client—ID. The tenant's enterprise application instance has its own service-principal object ID. Exchange's New-ServicePrincipal linkage requires the correct pair. Selecting the object ID from the app-registration object instead of the enterprise application is a common cause of a configuration that looks plausible but cannot authorize SMTP.

  1. 01

    Fix the tenant

    Confirm the single tenant in which the app, enterprise application, Exchange organization, and sender mailbox exist.

  2. 02

    Record both identifiers

    Keep the application ID and enterprise service-principal object ID labeled separately.

  3. 03

    Create or verify the Exchange reference

    Link the Entra application to the Exchange service-principal representation before assigning the role.

Least privilege

Make the intended sender visible in the resource scope.

A custom Exchange management scope can use recipient attributes or group membership to define the mailboxes an application may use. Pair that scope with exactly the application role needed for SMTP submission, then test both an intended mailbox and a mailbox that must remain outside the scope.

PrincipalCustomer-owned applicationCertificate-backed identity
Role and scopeApplication SMTP.SendAsAppRestricted recipient filter
ResourceAuthorized senderOther mailboxes excluded

Use Exchange's service-principal authorization test to inspect the effective in-scope role for a specific mailbox. Test negative cases as deliberately as the successful sender. Propagation can take time, so distinguish a newly created assignment from an incorrectly broad or permanently failed configuration.

Failure isolation

A 535 response does not identify the broken boundary by itself.

StageCheckTypical mistake
Token acquisitionTenant, token endpoint, certificate, private-key access, and https://outlook.office365.com/.default resourceWrong audience, expired certificate, or inaccessible private key
Exchange principalApplication ID and enterprise service-principal object IDUsing the app-registration object ID
Role assignmentCorrect application role and management scopeMissing role, wrong app, or scope that excludes the sender
SMTP submissionSMTP AUTH policy, sender identity, XOAUTH2 formatting, and TLSProtocol disabled or token submitted for a different identity

Preserve the complete Exchange response and verify each layer independently. Do not respond to an authorization failure by granting tenant-wide mail permissions merely to make the test pass.

Current implementation

RelayBridge uses the scoped App RBAC model.

RelayBridge v1.0.0-rc.1 uses a customer-owned single-tenant Entra application, a local non-exportable certificate, an Exchange service-principal reference, a sender group, a management scope, and one scoped Application SMTP.SendAsApp assignment. It does not request mailbox-reading access for delivery.

The released setup workflow verifies that the selected sender is in scope and that conflicting broad grants are absent. Use the administrator setup procedure for product configuration; this guide explains the underlying Microsoft authorization model and must not replace the supported wizard.

Clarifications

Frequently asked questions.

Does the certificate grant Send As permission?

No. It authenticates the application. Exchange authorization and the scoped sender resource are separate boundaries.

Should an App RBAC application also have SMTP.SendAsApp in Entra?

Microsoft's SMTP App RBAC onboarding guidance says not to add that application permission for the RBAC model. Review the complete environment before removing an existing grant because other integrations may depend on it.

Does App RBAC prevent every form of message spoofing?

No. It constrains the application's Exchange resource authority. Local client authorization, SMTP envelope policy, header handling, device restrictions, and downstream mail controls remain separate.

Authoritative sources

References.

Understand the boundary

Review the architecture before evaluation.

See how RelayBridge separates local SMTP intake from modern Microsoft 365 delivery, and review the current security model and limitations.