VBAuth
Technical White Paper
Entra App Permission Scope and Security Architecture: Monolithic vs Endpoint-Scoped App Registrations
Peter Bryant — Corylus Business Systems | Andrew Richards — The IT Service Ltd
This paper is a companion to “Microsoft Graph API Permissions and Security: Why Delegated Permissions Are the Only Safe Choice.” Readers are encouraged to read that paper first, as this paper builds directly on the concepts established there.
1. Introduction
The first paper in this series established that delegated permissions — where a token is always bound to an authenticated user — are the only safe model for Access applications calling the Microsoft Graph API. Application permissions, which bypass user authentication entirely, expose the client’s Microsoft 365 tenant to serious and demonstrable risk.
This paper addresses the next architectural question: once you have committed to delegated permissions, how should you structure the Azure Entra app registrations that underpin them? Specifically, should a single app registration carry all the permissions an application needs, or should permissions be defined at the level of individual API endpoints?
The answer has consequences for security posture, audit capability, and the frequency with which users are asked to authenticate. VBAuth is designed to give developers and their clients precise control over all three.
2. The Monolithic Permission Model
A monolithic app registration is one that requests all the permissions an application might ever need in a single Azure Entra registration. A developer building a comprehensive Microsoft 365 automation tool might request permissions such as Mail.Send, Contacts.Read, Calendars.ReadWrite, Files.Read, and Sites.Read.All within a single registration.
The practical appeal is straightforward: the user authenticates once, receives a token that covers all of these permissions, and can then use any function in the application without being asked to sign in again for the duration of that token’s lifetime.
2.1 Security Implications
The security cost of this convenience is a significantly enlarged blast radius. If a user’s session is compromised — for example through a stolen device, a session hijack, or a token interception — the attacker inherits every permission the token carries. A token obtained while the user was sending a routine email also grants access to their calendar, their contacts, their files, and their SharePoint sites.
It is important to be precise about what this risk actually requires in practice. VBAuth does not write bearer tokens to disk. A token exists only in memory for the duration of the application session. For a monolithic token to be exploited, an attacker would need to compromise the machine whilst the user is authenticated and the application is running, and would need to extract the token from memory during that window. Once the token expires — within Microsoft’s defined window of 60 to 90 minutes — VBAuth detects this before any API call is made and requires the user to authenticate again, provided the sample code patterns demonstrated in the VBAuth demo database are followed. An expired token is never presented to Entra ID.
This means that a token compromise of this kind requires a failure of endpoint security that is well outside VBAuth’s scope. If a machine is compromised to that degree, a bearer token in memory is the least of the IT department’s concerns. Responsibility for endpoint security sits firmly with the IT team and the end user, not with the developer or with VBAuth.
It is equally important to be precise about the nature and scope of that memory risk. MSAL’s internal token cache — the object that temporarily holds the access token and associated data during the authentication exchange — exists only for the duration of the call to GetAccessToken(). When that call returns, the authentication context goes out of scope and the memory it occupied becomes unreferenceable by any further code in the DLL or in VBA. As with all .NET objects, the memory is reclaimed when the garbage collector runs. It does not persist on the COM object that VBA holds and is unaffected by whether the developer retains or destroys that object. The following shows the complete sequence:
VBA calls objAuth.GetAccessToken()
→ C# GetAccessToken() begins
→ local var app created (fresh MSAL instance, empty cache)
→ interactive auth occurs
→ token returned
→ GetAccessToken() exits
→ app goes out of scope and is eligible for garbage collection
→ MSAL cache inside app goes out of scope, becomes unreferenceable, and is available for garbage collection
→ JSON string returned to VBA
VBA receives the string
The OAuth 2.0 protocol involves the exchange of short-lived tokens. As the final step in that process, VBAuth returns a bearer token to VBA with a lifetime of 60-90 minutes. When that token expires, a new authentication is required to obtain a fresh one.
Retaining the bearer token in VBA memory for its natural lifetime is both safe and good practice. The VBAuth complete demo database demonstrates this approach — caching the token in VBA memory against its expiry time and scope claims, so that switching between Entra app registrations within a session does not trigger unnecessary re-authentication where a valid token already exists. Bearer tokens should never be written to a table — temporary or otherwise — and should never be saved to disk.
It should be noted that residual data may remain in process memory until the garbage collector reclaims it — this is the same transient risk as the bearer token string that VBA itself holds. Token data held in process memory is not encrypted. Microsoft’s MSAL documentation describes optional encryption mechanisms for token caches, but these are available only in ASP.NET Core web application scenarios — Microsoft has not provided equivalent in-memory cache encryption support for .NET Framework 4.8 desktop applications. VBAuth is built on .NET Framework 4.8 because COM interop — the mechanism by which VBA calls the DLL — requires it. It is worth noting that once a token is acquired, the cache that holds it is entirely a Microsoft artifact — MSAL’s own code and memory management, outside the control of VBAuth’s DLL code entirely. VBAuth therefore has no means to apply cache encryption, and of course does not persist any token data to disk.
The risk is real nonetheless: a monolithic token, if compromised during its active window, carries a wider blast radius than a narrowly scoped one. The endpoint-scoped model limits what can be done even in the worst case.
2.2 Audit Limitations
Microsoft 365 records authentication events and API activity in the Entra sign-in logs and unified audit log. These logs are accessible directly in the Microsoft Entra admin centre at https://entra.microsoft.com under Identity → Monitoring & Health → Sign-in logs.
With a monolithic registration, all activity — reading email, accessing files, writing to a calendar — is associated with a single app identity. Distinguishing between routine low-sensitivity operations and access to sensitive resources requires examining individual API call records rather than authentication events. Depending on the organisation’s logging configuration and retention policy, this granularity may not always be available or straightforward to query.
3. The Endpoint-Scoped Model
An endpoint-scoped approach assigns permissions at the level of individual API endpoints rather than at the application level. Each function — sending an email, reading contacts, accessing a SharePoint document library — is associated with a specific set of permissions that covers only what that function requires.
In VBAuth, this maps directly to the structure of lclVBAuthAdmin. Each record defines a specific Graph API endpoint URL alongside the scope claims required to call it. Where two endpoints require identical scopes, VBAuth shares a single Azure app registration between them automatically — no unnecessary proliferation of registrations, no redundant consent events. Where endpoints require different scopes, separate registrations are created.
3.1 Security Posture
The security benefit is a precisely limited blast radius. A token issued for Mail.Send cannot be used to read files. A token issued for Contacts.Read cannot be used to write to a calendar. The scope of any credential compromise or session issue is bounded by what that specific token was issued to do.
This is not a posture that VBAuth imposes. It is an architectural capability that the developer and their client can choose to exploit to whatever degree is appropriate for their context. A developer building a low-sensitivity internal tool may reasonably consolidate permissions broadly. A developer building something that touches payroll data, financial records, or personally sensitive information has the tools to isolate those operations precisely.
Minimum privilege is not an inconvenience to be engineered around. It is a principle that limits the consequences of things going wrong, and endpoint-scoped permissions are the mechanism that makes it practical.
3.2 Deliberate Re-authentication as an Audit Control
The most significant and perhaps least obvious capability of the endpoint-scoped model is the ability to use authentication itself as a security control.
When a sensitive operation is assigned its own app registration with distinct scope claims, accessing that operation requires the user to authenticate specifically for it. This is not merely a technical consequence of the architecture — it is a deliberate design choice that a developer can make in consultation with their client’s IT team.
Every authentication event against a Microsoft Entra app registration is recorded in the Microsoft 365 sign-in logs. The log entry captures the user identity, the timestamp, the application name, and the scopes requested. These logs are tamper-evident and are accessible to the organisation’s IT team at https://entra.microsoft.com under Identity → Monitoring & Health → Sign-in logs.
The screenshot below shows a real example of VBAuth sign-in events as they appear in the Microsoft Entra admin centre. Each row represents a discrete authentication event, tied to a specific user identity, timestamp, and application — in this case VBAuth app registrations calling Microsoft Graph.

Figure 1: Microsoft Entra admin centre — Sign-in events showing VBAuth authentication activity. User principal names are partially obscured and request IDs and IP addresses have been redacted. Accessible at https://entra.microsoft.com → Identity → Monitoring & Health → Sign-in logs.
For a sensitive operation — initiating a payment, approving a purchase order, accessing an HR record — this creates a verifiable, tamper-evident record that a specific named individual authenticated and performed that action at a specific time. This is directly analogous to the principle of step-up authentication used in high-security web applications.
Forcing re-authentication on first access to a sensitive operation is not an inconvenience imposed on the user. It is a control that protects both the organisation and the user — by ensuring that access to sensitive operations requires explicit, logged authentication specific to that operation.
4. Authentication Frequency: An Honest Assessment
It would be dishonest to present endpoint-scoped permissions as having no cost. Where different endpoints carry different scope claims and therefore different app registrations, a user working across those endpoints will authenticate more frequently than if a single monolithic token covered everything.
VBAuth mitigates this in two ways. First, where endpoints share identical scope claims, a single app registration is shared and a single authentication event covers all of them. The developer controls how permissions are grouped, and grouping related functions together reduces authentication events without compromising the principle of minimum privilege.
Second, developers can retain the bearer token in VBA memory for its Microsoft-defined lifetime of 60 to 90 minutes, as demonstrated in the VBAuth complete demo database. A user who authenticates for a given set of scopes will not be prompted again for that set until the token expires. Where an application uses multiple Entra app registrations with different scope claims, a VBA-side token cache need not trigger unnecessary re-authentication when switching between features — only a genuinely new scope set requires a fresh sign-in.
The more important point is that where re-authentication occurs for a sensitive operation, that is not a cost to be minimised. It is the mechanism by which the security control works. An organisation that has decided that access to its financial data should require explicit authentication every time has made a deliberate and defensible security decision. The authentication event is the evidence that the control is operating.
5. The IT Manager’s Perspective
For an IT team evaluating a VBAuth-based application, the endpoint-scoped model offers several concrete advantages over a monolithic registration.
5.1 Granular Consent
Each app registration carries a specific, named set of permissions. The IT administrator granting admin consent can see exactly what each registration is authorised to do. There is no need to approve a broad permission set and trust that only a subset of it will be used.
5.2 Precise Revocation
If a specific function needs to be disabled — for example, if a business process is suspended or a security concern arises around a particular data source — the IT team can disable or delete the specific app registration for that function without affecting any other function. A monolithic registration offers only an all-or-nothing choice.
5.3 Restricting Access to Specific Users
The endpoint-scoped model opens the door to fine-grained access control that goes beyond scope claims alone. Paper 3 in this series explores how Azure Entra app roles can be used to restrict individual API functions to specific users or groups — adding a further layer of precision that makes the approach even more powerful for organisations with strict access control requirements.
5.4 Audit Clarity
Because sensitive operations have their own app registrations, authentication events for those operations are clearly distinguishable in the sign-in logs from routine low-sensitivity activity. An audit query for access to a financial data endpoint returns only events where that specific registration was used — a clean, unambiguous record of who accessed what and when.
6. Summary
The choice between a monolithic app registration and an endpoint-scoped approach is a deployment decision that sits with the developer and their client. VBAuth does not impose a posture — it provides the architecture to implement whatever posture is appropriate.
Where endpoints share identical scope claims, VBAuth automatically shares a single Azure app registration, minimising both the number of registrations and the frequency of authentication events. Where endpoints carry different scopes, separate registrations are created, giving the developer and client the option to use those registration boundaries as security and audit controls.
The most powerful application of this architecture is the deliberate use of re-authentication as a control for sensitive operations. By assigning a distinct scope to a high-value endpoint, the developer ensures that accessing it requires explicit authentication — an event that is logged in the Microsoft Entra sign-in logs against a named user at a specific time. For organisations with regulatory obligations, audit requirements, or simply a mature approach to information security, this is not a limitation of the VBAuth approach. It is one of its most valuable features.
Taken together with the delegated permission model described in the companion paper, endpoint-scoped permissions give Access developers a security architecture that is both honest and capable — one that respects the client’s security infrastructure rather than working around it.
This series was prepared with AI assistance. The technical content has been reviewed and verified by the authors.
VBAuth, developed and maintained by Andrew Richards (The IT Service Ltd) and Peter Bryant (Corylus Business Systems), © 2025–2026. All rights reserved. https://vbauth.com