Skip to main content

OAuth Management

The MachineMetrics CLI provides commands to manage OAuth clients for your applications.

OAuth Command

mmdev oauth [subcommand]

Manages OAuth clients for your MachineMetrics applications.

Available Subcommands

CommandDescription
dev-initCreate a new OAuth client for local development
dev-resetClear local development OAuth client information
dev-applyApply the local development OAuth client to the current project
add [options]Create a new OAuth client
list [options]List your OAuth clients (paginated)
update [options]Update an existing OAuth client's name and redirect URIs

Options for add

OptionDescription
-n, --name <name>Name of the client (required)
-r, --redirect <redirect>Comma-separated redirect URIs (required)
-h, --helpDisplay help for command

Options for list

OptionDescription
-o, --offset <offset>Pagination offset (default 0)
-l, --limit <limit>Page size (default 20)
-h, --helpDisplay help for command

Options for update

All three options are required: update replaces the client's name and its redirect URI list in one call, so re-supply the full redirect list even when you only want to rename.

OptionDescription
-i, --client-id <clientId>Client ID to update (find it with list)
-n, --name <name>New name of the client
-r, --redirect <redirect>Comma-separated redirect URIs
-h, --helpDisplay help for command

The client name is what end users see in the authorization prompt when they first launch your application, so update is how you control that branding.

Usage Examples

  1. Initialize local development OAuth client:

    mmdev oauth dev-init
  2. Reset local development OAuth client:

    mmdev oauth dev-reset
  3. Add a new OAuth client:

    mmdev oauth add --name "My App" --redirect "http://localhost:3000/callback,https://myapp.com/callback"
  4. Find a client's ID:

    mmdev oauth list
  5. Rename a client (keeping its redirect URIs):

    mmdev oauth update --client-id <clientId> --name "My App (Production)" --redirect "https://myapp.com/callback"