/authzero

A command line interface to the Auth0 Management API.

Primary LanguageJavaScriptMIT LicenseMIT

authzero

oclif Version CircleCI Downloads/week License PRs Welcome

A command line interface to the Auth0 Management API, using node.js, oclif, and TypeScript. Currently covers only a small portion of the read-only capabilities of the Management API.

The code is likely garbage (I am not a software engineer and node / typescript / javascript is all new to me) but it works. The project could use an overhaul by someone who knows idiomatic nodejs and typescript. Once the code is cleaned up a bit, maybe we'll push it to NPM.

WARNING: This utility relies on the Client Credentials exchange grant type to access your tenant's Management API. As such, it has access to whatever scopes you have assigned to the application in Auth0. If you have assigned scopes that allow making changes to your tenant, you can do some real damage with this utility (once we start adding change / update / patch features that is). YOU CAN BREAK ALL THE THINGS. Always check your .env file before working with the utility and always exercise extreme caution when working with a production tenant.

Setup

TODO: This section needs more detail.

Install node.js, oclif, typescript, and the node-auth0 library.

Create a Machine-to-Machine application in Auth0. Give your M2M application access to the Management API and assign approriate scopes (mostly read:* at the moment).

Possibly useful: Using Machine to Machine (M2M) Authorization

Clone the repo.

Create a .env file in root directory of the repo. You can use env.txt as a template.


To update the documentation below:

npx oclif-dev readme

Usage

$ npm install -g authzero
$ authzero COMMAND
running command...
$ authzero (-v|--version|version)
authzero/0.0.0 darwin-x64 node-v12.4.0
$ authzero --help [COMMAND]
USAGE
  $ authzero COMMAND
...

Commands

authzero client:get

Get client (application) settings.

USAGE
  $ authzero client:get

OPTIONS
  -h, --help   show CLI help
  -i, --id=id  (required) Client ID

See code: src/commands/client/get.ts

authzero connection:get

Get connection settings.

USAGE
  $ authzero connection:get

OPTIONS
  -h, --help   show CLI help
  -i, --id=id  (required) Connection ID

See code: src/commands/connection/get.ts

authzero help [COMMAND]

display help for authzero

USAGE
  $ authzero help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

authzero rule:get

Get rule.

USAGE
  $ authzero rule:get

OPTIONS
  -h, --help   show CLI help
  -i, --id=id  (required) Rule ID

See code: src/commands/rule/get.ts

authzero tenant:get

Get tenant settings.

USAGE
  $ authzero tenant:get

OPTIONS
  -h, --help  show CLI help

See code: src/commands/tenant/get.ts

authzero user:add

Create a new user.

USAGE
  $ authzero user:add

OPTIONS
  -f, --profile=profile  profile for the new user in JSON format
  -h, --help             show CLI help

See code: src/commands/user/add.ts

authzero user:get

Get profile for specificed user.

USAGE
  $ authzero user:get

OPTIONS
  -e, --email=email        email address of user
  -h, --help               show CLI help
  -i, --user_id=user_id    user_id of user
  -u, --username=username  username of user

See code: src/commands/user/get.ts