Azure / Azure/azure-powershell
Get-AzAccessToken with scope
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Description
Is it possible to use Get-AzAccessToken to get an MsGraph JWT with a specific scope?
It seems like the token that is returned has fewer / different scopes than when I just use PowerShell to get information from Entra ID directly.
I'm using that JWT to pass that into an application which uses the dotnet Graph SDK.
The jwt contains Directory.AccessAsUser.All as scope, and even though I tried as Global Administrator even, some calls using the Graph SDK (like reading the tenant authorisation policy) fail with a permission error.
Same user can see the policy in the portal or can even go to the web based Graph explorer and it works.
Any insights here?
Thanks.
### Script or Debug output
_No response_
### Environment data
_No response_
### Module versions
_No response_
### Error output
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.