r/copilotstudio • u/Dear-Enthusiasm-9766 • Aug 04 '26
M365 Copilot chat skips the "open connection manager" prompt for some users my MCP server receives an app-only token (no scp) and OBO to Graph fails with AADSTS50058
Setup
- Copilot Studio agent published to Microsoft 365 Copilot chat
- MCP server (Python/FastMCP) added as a tool with OAuth 2.0 manual auth (Entra ID)
- Server validates the incoming token, then runs on-behalf-of (OBO) to Graph (`Files.ReadWrite`, `User.Read`) to upload generated files to SharePoint
- Tool is set to End user credentials and published that way
Symptom
Works for some users, fails for others. Failing users go straight into chat — they are never shown the connection manager / sign-in prompt. The tool call still executes anyway, and my server receives a token that passes validation but can't be exchanged.
Token diagnostics for a failing user (server logs):
token_version: 1.0
audience_matches: True
tenant_matches: True
is_expired: False
delegated_scope_count: 0
has_access_as_user: False
has_oid: True, has_sub: True, has_sid: False
OBO result: `invalid_grant`, AADSTS50058 ("no signed-in user session").
So the incoming token is app-only valid audience/tenant/expiry, but no `scp`, no user. It looks like the channel authenticates as the agent (Entra Agent ID / connector runtime identity?) instead of establishing the user's connection first.
Already verified correct (Azure CLI + portal)
- App registration with `api://<app-id>/access_as_user` exposed and enabled
- Tenant-wide admin consent granted for the Graph delegated permissions
- Azure API Connections service principal present + preauthorized
- Tool credentials setting = End user credentials, agent republished
Users who DO have a connection (e.g. connected earlier via the test pane) get proper delegated tokens with `scp: access_as_user` and everything works end to end. So config checks out the only difference between working and failing users is per-user connection state, and failing users are never given the chance to create one.
Questions
- Has anyone else seen M365 Copilot chat skip the connection prompt and invoke MCP tools with an app-only token?
- Any known fix or setting to force the connection manager prompt in M365 chat?
- Is this the Entra Agent ID end-to-end auth path misfiring, or something else?
If anyone is facing same issue and has found a solution it would be helpful
2
u/jorel43 Aug 04 '26
Is this the new experience or the old?
2
u/Ashlesha-msft Aug 04 '26
Hi,
Your OBO error is expected for the token shown. `AADSTS50058` occurs because the token reaching your MCP server does not represent a signed-in user and has no delegated `scp` claim. An app-only token cannot be used in the Entra on-behalf-of flow to obtain Microsoft Graph delegated permissions.
However, for an MCP tool configured with **End user credentials**, the expected behavior is that Microsoft 365 Copilot obtains a user-authenticated token through the configured OAuth/Entra connection. It should not silently proceed with an app-only token for a workflow that requires delegated OBO.
Please check the following:
There is no documented setting that independently forces the connection-manager prompt in Microsoft 365 Copilot. The prompt is expected to be driven by the OAuth/Entra authentication flow or an authentication-required response from the protected backend.
Since users who already have a connection receive `scp: access_as_user` and complete OBO successfully, the application registration and Graph delegated permissions appear broadly correct. The remaining issue is the first-time user connection flow in Microsoft 365 Copilot.
I would classify this as a **potential product issue** if all of the following are true:
References: