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

DXCDT-275: README updates #566

Merged
merged 15 commits into from
Dec 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
219 changes: 53 additions & 166 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,27 @@
# Auth0 CLI (Experimental)
<div align="center">
<h1>Auth0 CLI</h1>

`auth0` is the command line to supercharge your development workflow.
[![Release](https://img.shields.io/github/v/release/auth0/auth0-cli?include_prereleases&style=flat-square)](https://github.com/auth0/auth0-cli/releases) [![Build Status](https://img.shields.io/github/actions/workflow/status/auth0/auth0-cli/go.yml?branch=main)](https://github.com/auth0/auth0-cli/actions?query=branch%3Amain) [![Go Report Card](https://goreportcard.com/badge/github.com/auth0/auth0-cli?style=flat-square)](https://goreportcard.com/report/github.com/auth0/auth0-cli) [![License](https://img.shields.io/github/license/auth0/auth0-cli.svg?style=flat-square)](https://github.com/auth0/auth0-cli/blob/main/LICENSE)

> Note: This CLI is an experimental release, and is built on a best-efforts basis by some Auth0 developers in their available innovation time. It is open-source licensed and free to use, and is not covered by any Auth0 Terms of Service or Agreements. If you have issues with this CLI you can engage with the project's developer community through the repository GitHub Issues list, or contribute fixes and enhancements of your own via a Pull Request.
</div>

Build, test, troubleshoot and manage your integration with **[Auth0](http://auth0.com/)** directly from your **terminal**.
Build, manage and test your [Auth0](http://auth0.com/) integrations from the command line.

![demo](./demo.gif)

---
## Highlights

- **🧪 Test your universal login flow:** Emulate your end users' login experience by running `auth0 test login`.
- **🔍 Troubleshoot in real-time:** Inspect the events of your Auth0 integration as they happen with the `auth0 logs tail` command.
- **🔁 Simplify repetitive tasks:** Create, update, list and delete your Auth0 resources directly from the terminal.

## Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Authenticating to Your Tenant](#authenticating-to-your-tenant)
- [Available Commands](#available-commands)
- [Customization](#customization)
- [Anonymous Analytics](#anonymous-analytics)
- [Contributing](#contributing)
- [Author](#author)

---

## Features

### 🧪 Test the login flow at any time

You can easily test out the Universal Login box of your Auth0 application by running `auth0 test login`. This initiates a login flow in your browser. Once you complete the process, the Auth0 CLI will display your profile information and credentials.

### ⚡️ Get up and running quickly

You can also download a QuickStart sample application that’s already configured for your Auth0 application with `auth0 quickstarts download`. Just install the dependencies, and the sample application will be ready to run. Use it as an example integration to help set up Auth0 in your own application.

### 🔍 Find issues faster

If you encounter difficulties setting up your integration, use the Auth0 CLI to tail your tenant’s logs for a smoother troubleshooting experience. `auth0 logs tail` will let you inspect the authentication events as they happen. You can easily filter the events from a single Auth0 application with `--filter "client_id:<client-id>"` and use `--debug` to get the raw error details.

### 🔁 Simplify repetitive tasks

With the Auth0 CLI, you can:

- Manage your Auth0 applications, rules, and APIs right from the terminal.
- Create, update, and delete resources interactively.
- List all your resources or inspect them individually.

## Installation

Expand All @@ -69,7 +48,7 @@ Install via [cURL](https://curl.se/):

```bash
# Binary will be downloaded to "./auth0".
curl -sSfL https://raw.githubusercontent.com/auth0/auth0-cli/v1/install.sh | sh -s -- -b .
curl -sSfL https://raw.githubusercontent.com/auth0/auth0-cli/main/install.sh | sh -s -- -b .
```

### Manual
Expand All @@ -92,9 +71,9 @@ Install via [Go](https://go.dev/):
go install github.com/auth0/auth0-cli/cmd/auth0@latest
```

## Authentication
## Authenticating to Your Tenant

Authenticating to your tenant is required for most functions of the CLI. It can be initiated by running:
Authenticating to your Auth0 tenant is required for most functions of the CLI. It can be initiated by running:

```bash
auth0 login
Expand All @@ -108,167 +87,75 @@ There are two ways to authenticate:
> **Warning**
> Authenticating as a user is not supported for **private cloud** tenants. Instead, those users should authenticate with client credentials.

## Usage

After installation, you should have the `auth0` command available:

```bash
auth0 [command]

# For any help, run --help after a specific command, e.g.:
auth0 [command] --help
```
## Available Commands

- [auth0 actions](https://auth0.github.io/auth0-cli/auth0_actions.html) - Manage resources for actions
- [auth0 api](https://auth0.github.io/auth0-cli/auth0_api.html) - Makes an authenticated HTTP request to the Auth0 Management API
- [auth0 apis](https://auth0.github.io/auth0-cli/auth0_apis.html) - Manage resources for APIs
- [auth0 apps](https://auth0.github.io/auth0-cli/auth0_apps.html) - Manage resources for applications
- [auth0 attack-protection](https://auth0.github.io/auth0-cli/auth0_attack_protection.html) - Manage attack protection settings
- [auth0 branding](https://auth0.github.io/auth0-cli/auth0_branding.html) - Manage branding options
- [auth0 completion](https://auth0.github.io/auth0-cli/auth0_completion.html) - Setup autocomplete features for this CLI on your terminal
- [auth0 domains](https://auth0.github.io/auth0-cli/auth0_domains.html) - Manage custom domains
- [auth0 email](https://auth0.github.io/auth0-cli/auth0_email.html) - Manage email settings
- [auth0 ips](https://auth0.github.io/auth0-cli/auth0_ips.html) - Manage blocked IP addresses
- [auth0 login](https://auth0.github.io/auth0-cli/auth0_login.html) - Authenticate the Auth0 CLI
- [auth0 logout](https://auth0.github.io/auth0-cli/auth0_logout.html) - Log out of a tenant's session
- [auth0 logs](https://auth0.github.io/auth0-cli/auth0_logs.html) - View tenant logs
- [auth0 orgs](https://auth0.github.io/auth0-cli/auth0_orgs.html) - Manage resources for organizations
- [auth0 protection](https://auth0.github.io/auth0-cli/auth0_protection.html) - Manage resources for attack protection
- [auth0 quickstarts](https://auth0.github.io/auth0-cli/auth0_quickstarts.html) - Quickstart support for getting bootstrapped
- [auth0 roles](https://auth0.github.io/auth0-cli/auth0_roles.html) - Manage resources for roles
- [auth0 rules](https://auth0.github.io/auth0-cli/auth0_rules.html) - Manage resources for rules
- [auth0 tenants](https://auth0.github.io/auth0-cli/auth0_tenants.html) - Manage configured tenants
- [auth0 test](https://auth0.github.io/auth0-cli/auth0_test.html) - Try your Universal Login box or get a token
- [auth0 universal-login](https://auth0.github.io/auth0-cli/auth0_universal-login.html) - Manage the Universal Login experience
- [auth0 users](https://auth0.github.io/auth0-cli/auth0_users.html) - Manage resources for users

### Creating an application

If you haven't created an application yet, you may do so by running the
following command:

```bash
auth0 apps create
```

A screen similar to the following will be presented after successful app creation:

```bash
$ auth0 apps create
Name: My Awesome App
Description: Test app
Type: Regular Web Application
Callback URLs: http://localhost:3000
Allowed Logout URLs: http://localhost:3000

=== travel0.auth0.com application created

CLIENT ID wmVzrZkGhKgglMRMvpauORCulBkQ5qeI
NAME My Awesome App
DESCRIPTION Test app
TYPE regular web application
CLIENT SECRET kaS2NR5nk2PcGuITQ8JoKnpVnc5ky1TuKgsb6iTA08ec8XqizqkDupKhEIcsFiNM
CALLBACKS http://localhost:3000
ALLOWED LOGOUT URLS http://localhost:3000
ALLOWED ORIGINS
ALLOWED WEB ORIGINS
TOKEN ENDPOINT AUTH
GRANTS implicit, authorization_code, refresh_token, client_credentials

▸ Quickstarts: https://auth0.com/docs/quickstart/webapp
▸ Hint: Test this app's login box with 'auth0 test login wmVzrZkGhKgglMRMvpauORCulBkQ5qeI'
▸ Hint: You might wanna try 'auth0 quickstarts download wmVzrZkGhKgglMRMvpauORCulBkQ5qeI'
```

As you might observe, the next thing to do would likely be to try logging in
using the client ID.

### Test the login flow

Whether or not you've created the application using the CLI or the management
dashboard, you'll be able to test logging in using a specific application.

If you have the client ID, you may pass it as an argument,
otherwise a prompt will be presented:

```bash
auth0 test login
```

### Tail your logs

Once you have a few logins in place, you might want to tail your logs. This is
done by running the following command:

```bash
auth0 logs tail
```

After running that, one might see the following output:

```
Success Login 9 minutes ago Username-Password-Authentic... my awesome app
```
## Customization

If there are errors encountered, such as the following example, you may run it
with the `--debug` flag as follows:
To change the text editor used for editing templates, rules, and actions,
set the environment variable `EDITOR` to your preferred editor. Example:

```bash
auth0 logs tail --debug
```shell
export EDITOR="code -w"
# or
export EDITOR="nano"
```

The full raw data will be displayed below every error:
## Anonymized Analytics Disclosure

```
Failed Login hello 7 minutes ago N/A my awesome app

id: "90020210306002808976000921438552554184272624146777636962"
logid: "90020210306002808976000921438552554184272624146777636962"
date: 2021-03-06T00:28:04.91Z
type: f
clientid: vXAtoaFdhlmtWjpIrjb9AUnrGEAOH2MM
clientname: my awesome app
ip: 1.2.3.4
description: hello
locationinfo: {}
details:
body:
action: default
password: '*****'
state: QXV0aDAgaXMgaGlyaW5nISBhdXRoMC5jb20vY2FyZWVycyAK
username: [email protected]
connection: Username-Password-Authentication
error:
message: hello
oauthError: access_denied
type: oauth-authorization
qs: {}
session_id: QXV0aDAgaXMgaGlyaW5nISBhdXRoMC5jb20vY2FyZWVycyAK
userid: auth0|QXV0aDAgaXMgaGlyaW5nISBhdXRoMC5jb20vY2FyZWVycyAK
```

## Customization
Anonymized data points are collected during the use of this CLI. This data includes the CLI version, operating system, timestamp, and other technical details that do not personally identify you.

To change the text editor used for editing templates, rules, and actions,
set the environment variable `EDITOR` to your preferred editor:
Auth0 uses this data to better understand the usage of this tool to prioritize the features, enhancements and fixes that matter most to our users.

`export EDITOR="code -w"`
To **opt-out** of this collection, set the `AUTH0_CLI_ANALYTICS` environment variable to `false`.

`export EDITOR="nano"`
## Feedback

## Anonymous Analytics
### Contributing

By default, the CLI tracks some anonymous usage events. This helps us understand how the CLI is being used, so we can continue to improve it. You can opt-out by setting the environment variable `AUTH0_CLI_ANALYTICS` to `false`.
We appreciate feedback and contribution to this repo! Before you get started, please see the following:

### Data sent
- [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
- [Auth0's code of conduct guidelines](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)
- [This repo's contribution guide](https://github.com/auth0/auth0-cli/blob/main/CONTRIBUTING.md)

Every event tracked sends the following data along with the event name:
### Raise an issue

- The CLI version.
- The OS name: as determined by the value of `GOOS`, e.g. `windows`.
- The processor architecture: as determined by the value of `GOARCH`, e.g. `amd64`.
- The install ID: an anonymous UUID that is stored in the CLI's config file.
- A timestamp.
To provide feedback or report a bug, please [raise an issue on our issue tracker](https://github.com/auth0/auth0-cli/issues).

## Contributing
### Vulnerability Reporting

Please check the [contributing guidelines](CONTRIBUTING.md).
Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/responsible-disclosure-policy) details the procedure for disclosing security issues.

## Author
---

[Auth0](https://auth0.com)
<p align="center">
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png" width="150">
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.auth0.com/website/sdks/logos//auth0_dark_mode.png" width="150">
<img alt="Auth0 Logo" src="https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png" width="150">
</picture>
</p>
<p align="center">Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout <a href="https://auth0.com/why-auth0">Why Auth0?</a></p>
<p align="center">
This project is licensed under the MIT license. See the <a href="https://github.com/auth0/auth0-cli/blob/main/LICENSE"> LICENSE</a> file for more info.</p>