Skip to content
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

Block a user account #683

Open
1 task done
hexpunk opened this issue Mar 24, 2023 · 2 comments
Open
1 task done

Block a user account #683

hexpunk opened this issue Mar 24, 2023 · 2 comments
Labels
feature request A feature has been asked for or suggested by the community

Comments

@hexpunk
Copy link

hexpunk commented Mar 24, 2023

Checklist

Describe the problem you'd like to have solved

I sometimes find myself in a situation where I want to block many users at once. It would be nice to be able to script it in a shell script using the Auth0 cli.

Currently the Auth0 cli provides commands to list and remove blocks on user accounts, but no way to add a block.

Looking at the Auth0 API, it seems like the action I would want would be to set "blocked" to true on the user update endpoint. No equivalent flag is available on the auth0 users update command.

Describe the ideal solution

There should be a way to block a user using the Auth0 cli tool that's equivalent to blocking a user in the management dashboard.

Either an argument in auth0 users update, which would seem to match how this task would be accomplished using the User Management API, or a command like auth0 users blocks add.

Alternatives and current workarounds

As implied earlier, I could use the User Management API with curl or equivalent, but it would be a smoother workflow to use the cli tool that is already authenticated rather than having to set up a token-based way to authenticate.

Additional context

No response

@hexpunk hexpunk added the feature request A feature has been asked for or suggested by the community label Mar 24, 2023
@ewanharris
Copy link
Contributor

Hey @hexpunk, whilst this isn't supported by the auth0 users update command currently, in the v1 beta you could achieve this using the auth0 api command that allows you to make authenticated requests to the Management API.

So to block a user you would use the following command auth0 api patch "users/<user_id>" --data "{\"blocked\": true }.

@hexpunk
Copy link
Author

hexpunk commented Mar 31, 2023

@ewanharris Thanks for the tip! I completely overlooked the auth0 api subcommand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A feature has been asked for or suggested by the community
Projects
None yet
Development

No branches or pull requests

2 participants