setup permissions custom uses User.Read token for OAuth2 grant operation
Los mantenedores suelen responder en 5 días
@ajmfehr ya está trabajando en esto.
Desde el 10/8/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Summary
a365 setup permissions custom attempts to create/read oauth2PermissionGrants with a Microsoft Graph token requested for only User.Read. The operation fails with Authorization_RequestDenied even when the signed-in user is a Global Administrator.
Environment
- Agent 365 CLI:
1.1.214+90c444832f - Windows / PowerShell
- Signed-in user: Global Administrator
Reproduction
a365 setup permissions custom `
--resource-app-id 90ecec28-f5a6-42b3-9bde-dae1ca98f8b5 `
--scopes "Computer.See,Computer.Control" `
--verbose
Actual behavior
The CLI successfully adds the resource to the blueprint's requiredResourceAccess, then fails while reading/creating the OAuth2 permission grant:
OAuth2 permission grant failed ... Authorization_RequestDenied:
Insufficient privileges to complete the operation.
Verbose logging shows the token provider explicitly requests and reuses a Graph token scoped only to User.Read:
Acquiring Graph token via token provider (... scopes: User.Read)
Reusing cached Graph token ... ::User.Read::...
Graph POST /v1.0/oauth2PermissionGrants ... failed 403 Forbidden
The CLI then reports that tenant admin action is required even though the user is a Global Administrator.
Expected behavior
The CLI should acquire a Graph token containing the permission required by the Graph operation—at minimum DelegatedPermissionGrant.ReadWrite.All—or drive the documented admin-consent handoff when its client app lacks that permission.
Microsoft Graph documents DelegatedPermissionGrant.ReadWrite.All as the least-privileged permission for POST /oauth2PermissionGrants:
https://learn.microsoft.com/graph/api/oauth2permissiongrant-post?view=graph-rest-1.0#permissions
Workaround / validation
Using an independently acquired Graph token containing DelegatedPermissionGrant.ReadWrite.All succeeds for the grant operation. The remaining blueprint inheritance entry can also be created directly through the official inheritablePermissions Graph API.
This issue is especially confusing because the user's directory role is sufficient, but both the directory role and the client token's Graph scopes are required.
- Lenguaje dominante
- C#
- Estrellas
- 61
- Forks
- 35
- Merge medio
- 5 d 22 h
- PR fusionados (30 d)
- 4
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/Agent365-devTools
-
Two hardening notes from a blind pre-registered read at ea1579f: AgenticUserId skips ValidateGuid before an az shell-out; config secret has no file-mode hardening on macOS/LinuxQuizá libre de nuevo @ajmfehr la tomó hace 36 días y no hay ningún pull request abierto. Abiertoenhancement escalated feature P1 security
microsoft/Agent365-devTools#493 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 5 días
-
setup blueprint: identifierUris set to api://<appId> instead of api://botid-<appId>, breaking Teams message deliveryQuizá libre de nuevo @ajmfehr la tomó hace 73 días y no hay ningún pull request abierto. Abiertobug escalated P1 security
microsoft/Agent365-devTools#482 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 5 días
Todos los issues de microsoft/Agent365-devTools
Issues similares
-
python triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microsoft/semantic-kernel#14590 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
nkdAgility/azure-devops-migration-tools#3226 ·
Los mantenedores suelen responder en 1 día
-
t/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
dotnet/maui#39362 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día