Skip to content

403 Forbidden on _api/contextinfo for non-Copilot licensed users via usePwBrokeredAuth=true #30

Description

@JonEricEubanks

When a user with a standard Microsoft 365 Business Premium license (no M365 Copilot add-on) triggers the My Day Copilot Component, the SPFx runtime fails with 403 Forbidden on every SharePoint REST API call. The component never renders and shows "An error has occurred on the server."

Users with an M365 Copilot license work correctly.

Steps to reproduce

Deploy my-day.sppkg to the tenant App Catalog and sync to Teams
Sign into Microsoft 365 Copilot Chat as a user with only M365 Business Premium (no Copilot add-on)
Invoke the My Day agent: "What does my day look like?"
Component fails to render — "An error has occurred on the server"
Expected behavior

Per Microsoft's own blog post (devblogs.microsoft.com):

"No license barrier to start – built on declarative agents, which enable baseline agent experiences with simply a Microsoft 365 user license."

The component should render for any user with a standard M365 license that includes SharePoint Online.

Actual behavior

The PortableComponent.aspx loads with &usePwBrokeredAuth=true. The brokered auth token provided for non-Copilot users does not include
SharePoint API scopes, causing:
POST https://[tenant].sharepoint.com/_api/contextinfo → 403 Forbidden
POST https://[tenant].sharepoint.com/_api/web/GetClientSideComponents → 403 Forbidden

Console evidence:
portable-component-assembly...js:221
POST https://communityessentials.sharepoint.com/_api/contextinfo 403 (Forbidden)

portable-component-assembly...js:221
POST https://communityessentials.sharepoint.com/_api/web/GetClientSideComponents 403 (Forbidden)

Environment

SPFx version: 1.24.0-beta.2
Tenant: Production M365 tenant
Working account: M365 Business Premium + M365 Copilot add-on ✅
Failing account: M365 Business Premium only (no Copilot add-on) ❌
Browser: Edge / Chrome
Surface: Microsoft 365 Copilot Chat (copilot.microsoft.com and Teams)
Root cause hypothesis

The usePwBrokeredAuth token issued by Copilot Chat for non-Copilot licensed users does not include SharePoint API permission scopes. M365 Copilot licensed users receive a richer token that includes these scopes.

Additional context

The root SharePoint site has "Everyone except external users" as Site Members, so SharePoint permissions are not the issue. The failing account can browse SharePoint normally when not using the brokered auth flow.

See attached screenshots:

Image

shows clean console with M365 Copilot license (no 403s, AppBridge initialized); [screenshot-failing.png] shows 403s with Business Premium only."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions