Can I export grants of Auth0 Management API using cli?

I configured the Deploy CLI Application based on the official document as below.

then, I want to export this configuration, especially so many permissions, in my local and then I want to import to the other Auth0 tenant.

However, the grants of the Auth0 Management API are not exported. (I got other grants) and I tried exporting from the other Auth0 tenant, but I could not get grants of Management API as well.

export command: a0deploy export -c config.json -o exportpath -f directory

Should I configure the Deploy CLI Application at each Auth0 tenant manually again and again? is it cli’s specification?

please tell me if anyone has any information, thanks!

Hi, yes you should be able to export grants for the resource servers (API) in your tenant.

Verify you have the Auth0 Management API is authorized on the Deploy CLI M2M app you created in the tenant.

  • Go to Applications > CLI Deploy m2m app (the one you created)
  • Go to API Tab
  • Make sure that Auth0 Management API is authorized and all the permissions are selected.

You can also verify that Auth0 is returning grants from the Management API using the website directly: Auth0 Management API v2

Hope this helps!

2 Likes

thank you to reply marcus,

I couldn’t do what you said.
and I asked Auth0 support and I got the answer that Auth0 Deploy CLI can not export/import the scopes by itself, as below.

So, I have been able to export everything, by exception of the grants that belong to the client that has been used to run the auth0-cli.

Regarding the client_id xxxauth0-deploy-cli-extension-idxxx , after investigating with internal teams, this happens due to the fact that we skip exporting of the Deploy CLI’s own client grants because they are not meant to be changed as it can lead to breaking changes.

In a scenario where you are copying one tenant’s configuration to another tenant, the new tenant should already have the Deploy CLI Tool’s Application created and setup, otherwise you won’t be able to import anything to this tenant.

so, we need the scope of cli-applciation manually for each tenant.

thanks!

1 Like

Perfect! Thanks for sharing it with the rest of community!

1 Like