auth0-cli icon indicating copy to clipboard operation
auth0-cli copied to clipboard

Ability to Assign Users to Roles

Open davidski opened this issue 2 years ago • 3 comments

Describe the problem you'd like to have solved

Creating users via the command line is terrific. My standard flow is to create a user and add them to an app-specific role. While the CLI has options to create/delete roles, I cannot find any commands to manage user/role membership.

Describe the ideal solution

Expand the user create subcommand to allow one or more roles to be specified for the user. Optionally expand the role command to allow memberships to be managed at the role level.

Alternatives and current work-arounds

Create users via the CLI and then assign users to roles via the management GUI. 😢

davidski avatar Oct 13 '21 19:10 davidski

Hi @davidski, thanks for raising this! This is something we can definitely improve. I'll leave this issue open to track it.

Widcket avatar Oct 13 '21 20:10 Widcket

Hi, folks! Just checking to see if this request is on the roadmap for implementation. Would really like to be able to perform auth0 management entirely via the CLI. ❤️

davidski avatar Sep 20 '22 10:09 davidski

Hey @davidski, thanks for raising this again with us and apologies for the delay in tackling this.

To be super transparent with you, at the present moment our team has a limited bandwidth to dedicate to the auth0-cli as we're focusing on pushing https://github.com/auth0/terraform-provider-auth0 to a stable v1 release.

However we're planning on bringing feature parity with the management api for auth0-cli as well in ~ Q4 2022 / Q1 2023 (be advised that plans could still shift and this is just a super rough ETA).

Thanks a lot for the patience! Fully managing every aspect of an Auth0 Tenant from the cli will soon be available :)

sergiught avatar Sep 20 '22 13:09 sergiught

Hey @davidski 👋🏻 ,

We recently added a new command 🧰 auth0 api <method> <url-path> [flags] that is able to make authenticated requests against the management API (https://auth0.com/docs/api/management/v2).

:octocat: This command is available with https://github.com/auth0/auth0-cli/releases/tag/v0.13.0.

📖 Docs for this command: https://auth0.github.io/auth0-cli/auth0_api.html

Although it doesn't offer first class support for managing user roles, you could use it as an alternative until we have a more dedicated command for this.

For example to assign roles to a user: auth0 api post "users/{id}/roles" --data "{ ...payload... }"

Feedback is much appreciate for this new command 🙏🏻 Let us know if you encounter any issues with it.

We'll keep this issue open however until we are able to add a dedicated first class command to manage user roles.

Thanks for your patience! ❤️

sergiught avatar Dec 01 '22 15:12 sergiught

Update: We've added first-class support for assign roles to a user in the v1.0.0-beta.1 release. For those who are so inclined, we'd be happy to receive feedback on the beta before it goes GA, including feedback on this particular issue. Otherwise, we plan to close this issue out once v1.0.0 reaches GA. Again, appreciate everyone's patience!

willvedd avatar Jan 24 '23 21:01 willvedd

Update 2: We've released first-class support for role assignment in our v1.0.0. We encourage folks to upgrade and give it a shot!

willvedd avatar Apr 14 '23 16:04 willvedd