-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
403 The caller is not authorized with azuread provider and identitygovernance resource using az cli auth #1069
Comments
@benjy44 Thanks for reporting this issue. I am able to reproduce and despite holding the Global Admin role I received the same error message. This happened on both the v1.0 and beta APIs - although the provider is using the v1.0 API for this particular data source. Unfortunately this is either an API bug, or a documentation bug, on the part of Microsoft Graph. I have reported this upstream at microsoftgraph/msgraph-metadata#327 and would recommend opening an Azure support ticket or contact your account manager to raise this bug. Since this is apparently an API bug, or possibly a documentation bug (although I repro'd this whilst having Global Administrator so I'm more inclined to suspect the former.), there is unfortunately nothing we can do to mitigate or resolve this problem. Its worth nothing that this doesn't happen when I authenticate with an access token for an application obtained by client credentials flow, so this might be a viable workaround, if this is an option for you. |
Thanks for the quick reply @manicminer |
Hello I use a SP with Identity governance administrator role (also I tried with global admin role) and it's not working on my side anymore. │ Error: Waiting for deletion of access package assignment policy with object ID "GUID" Thanks @benjy44 to reported it and @manicminer for pointing us the graph api bug. |
To work properly on Entitlement management, Azure AAD terraform provider SPN need to have 2 permissions :
It's a requirement and it should be added in the documentation Thanks a lot to Microsoft support to help me on this case |
I think I got the solution here: I got the error
So the missing piece is that a Global Admin needs to run this command and grant admin consent that az cli can use that permission for the tenant |
There's a recent issue been raise for this with the azure-cli team Azure/azure-cli#30149 |
Community Note
Terraform (and AzureAD Provider) Version
Affected Resource(s)
azuread_access_package_catalog
and other identity governance resourcesTerraform Configuration Files
Debug Output
https://gist.github.com/benjy44/987488983fe02474bbff870a690537d7
Expected Behavior
No error
Actual Behavior
Steps to Reproduce
terraform apply
Important Factoids
I can see in the debug logs the URL not authorized:
https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/catalogs/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Now if I tried to access this url with az I get the same error:
If I inspect my JWT token from az account get-access-token --scope https://graph.microsoft.com/.default I do see that the scopes are limited:
I can add that using a token obtained from graph explorer, I can curl the same graph endpoint without issue, using the token from az cli I cannot curl and get 403.
The only difference between the tokens is the scope, which contains EntitlementManagement.Read.All for example in the graph explorer token.
I expect
Directory.AccessAsUser.All
to allow identity governance resources, however I cannot find any doc from Microsoft that would confirm this or not.Am I correct to assume that terraform cannot work with az cli auth for identitygovernance resources due to those limited scope in the token? If so it would be nice to update the doc.
Or am I missing something else? Can anyone confirm that these identity governance resources work with az cli login as user?
The text was updated successfully, but these errors were encountered: