Skip to content

canvas auth login

canvas auth login

Authenticate with a Canvas instance

Synopsis

Authenticate with a Canvas instance using OAuth 2.0 with PKCE.

The login command starts an OAuth flow to authenticate with Canvas. By default, it will try to open a local callback server. If that fails, it will fall back to out-of-band (manual copy-paste) mode.

If --instance is provided and the instance exists in your config, the URL and OAuth credentials will be loaded automatically. You can override them with flags.

Examples:

# Login using a configured instance (recommended)
canvas auth login --instance prod

# Login with URL (creates new instance)
canvas auth login https://canvas.instructure.com

# Login with custom OAuth credentials
canvas auth login --instance prod --client-id YOUR_ID --client-secret YOUR_SECRET

# Force out-of-band mode (for headless systems)
canvas auth login --instance prod --mode oob
canvas auth login [instance-url] [flags]

Options

      --client-id string       OAuth client ID
      --client-secret string   OAuth client secret
  -h, --help                   help for login
      --instance string        Instance name (defaults to hostname)
      --mode string            OAuth mode: auto, local, oob (default "auto")

Options inherited from parent commands

      --as-user int       Masquerade as another user (admin feature, requires permission)
      --columns strings   Select specific columns to display (comma-separated)
      --config string     config file (default is $HOME/.canvas-cli/config.yaml)
      --dry-run           Print curl commands instead of executing requests
      --filter string     Filter results by text (case-insensitive substring match)
      --limit int         Limit number of results for list operations (0 = unlimited)
      --no-cache          Disable caching of API responses
  -o, --output string     Output format: table, json, yaml, csv (default "table")
      --show-token        Show actual token in dry-run output (default: redacted)
      --sort string       Sort results by field (prefix with - for descending, e.g., -name)
  -v, --verbose           Enable verbose output

SEE ALSO

Auto generated by spf13/cobra on 25-Jan-2026