8.11.2 • Published 28 days ago

@heroku-cli/plugin-oauth-v5 v8.11.2

Weekly downloads
11,660
License
ISC
Repository
github
Last release
28 days ago

Heroku OAuth CircleCI

Code Climate npm version License

js-standard-style

Command line plugin for managing OAuth clients, authorizations and tokens.

No need to install, this plugin comes built into the Heroku CLI.

Clients

To create a client:

$ heroku clients:create "Amazing" https://amazing-client.herokuapp.com/auth/heroku/callback
Creating Amazing... done
HEROKU_OAUTH_ID=3e304bda-d376-4278-bdea-6d6c08aa1359
HEROKU_OAUTH_SECRET=e6a5f58f-f8a9-49f1-a1a6-d1dd98930ef6

See OAuth clients under your account with:

$ heroku clients
Amazing  3e304bda-d376-4278-bdea-6d6c08aa1359  https://amazing-client.herokuapp.com/auth/heroku/callback

Get details about a client:

$ heroku clients:info 36120128-fee7-455e-8b7f-807aee130946
=== Amazing
created_at:         2016-01-21T02:11:57Z
id:                 36120128-fee7-455e-8b7f-807aee130946
name:               Amazing
redirect_uri:       https://amazing-client.herokuapp.com/auth/heroku/callback
secret:             a14cf558-60b8-44f2-a804-3b249b48aa57
updated_at:         2016-01-21T02:11:57Z

Update clients:

$ heroku clients:update 3e304bda-d376-4278-bdea-6d6c08aa1359 --url https://amazing-client.herokuapp.com/auth/heroku/callback
Updated Amazing... done

Authorizations

List them:

$ heroku authorizations
Amazing                        9e3a4063-b833-432e-ad75-4b0d7195be13  global
Heroku CLI                     676cb46c-7597-4be1-8a6a-f87b9f2f1065  global

Creating

You can create a special user-created authorization against your account that will come with an access token which doesn't expire:

$ heroku authorizations:create --description "For use with Anvil"
Created OAuth authorization.
  ID:          105a7bfa-34c3-476e-873a-b1ac3fdc12fb
  Description: For use with Anvil
  Token:       4cee516c-f8c6-4f14-9edf-fc6ef09cedc5
  Scope:       global

You can also pass in short output format to only output the token.

$ heroku authorizations:create --output-format short
nec6a9b6-b21a-4ba1-il95-70zd47e14c4d

Another option allows for tokens that expire. This token expires in 10 seconds.

$ heroku authorizations:create --expires-in 10
Created OAuth authorization.
  Client:      <none>
  ID:          2231biha6-5b1e-4268-ba04-2ee7b74m2gf6
  Description: Long-lived user authorization
  Scope:       global
  Token:       9aa5d667-fg37-4028-8dc9-b2191b5z5966

A combination of short format and expires-in can be handy to pass into a job that needs access to heroku:

$ heroku run "HEROKU_EMAIL=`heroku auth:whoami` HEROKU_API_KEY=`heroku authorizations:create --expires-in 120 --output-format short` ./my_job.sh" -a myapp

Optionally, you can specify a list of scopes for the authorization:

$ heroku authorizations:create --description "For use with Anvil" --scope identity,read-protected
Created OAuth authorization.
  ID:          105a7bfa-34c3-476e-873a-b1ac3fdc12fb
  Description: For use with Anvil
  Token:       4cee516c-f8c6-4f14-9edf-fc6ef09cedc5
  Scope:       identity, read-protected

The procured token can now be used like an API key:

$ curl -u ":4cee516c-f8c6-4f14-9edf-fc6ef09cedc5" https://api.heroku.com/apps

Revoking

Any authorization on your account can be revoked at any time:

$ heroku authorizations:revoke 105a7bfa-34c3-476e-873a-b1ac3fdc12fb
Revoked authorization from "Another App".

heroku authorizations

list OAuth authorizations

USAGE
  $ heroku authorizations [-j]

FLAGS
  -j, --json  output in json format

DESCRIPTION
  list OAuth authorizations

See code: lib/commands/authorizations/index.js

heroku authorizations:create

create a new OAuth authorization

USAGE
  $ heroku authorizations:create [-d <value>] [-s <value>] [-e <value>] [-S] [-j]

FLAGS
  -S, --short                only output token
  -d, --description=<value>  set a custom authorization description
  -e, --expires-in=<value>   set expiration in seconds (default no expiration)
  -j, --json                 output in json format
  -s, --scope=<value>        set custom OAuth scopes

DESCRIPTION
  create a new OAuth authorization
  This creates an authorization with access to your Heroku account.

See code: lib/commands/authorizations/create.js

heroku authorizations:destroy ID

revoke OAuth authorization

USAGE
  $ heroku authorizations:destroy ID

DESCRIPTION
  revoke OAuth authorization


ALIASES
  $ heroku authorizations:destroy
  $ heroku authorizations:revoke

heroku authorizations:info ID

show an existing OAuth authorization

USAGE
  $ heroku authorizations:info ID [-j]

FLAGS
  -j, --json  output in json format

DESCRIPTION
  show an existing OAuth authorization

See code: lib/commands/authorizations/info.js

heroku authorizations:revoke ID

revoke OAuth authorization

USAGE
  $ heroku authorizations:revoke ID

DESCRIPTION
  revoke OAuth authorization


ALIASES
  $ heroku authorizations:destroy
  $ heroku authorizations:revoke

See code: lib/commands/authorizations/revoke.js

heroku authorizations:rotate ID

updates an OAuth authorization token

USAGE
  $ heroku authorizations:rotate ID

DESCRIPTION
  updates an OAuth authorization token

See code: lib/commands/authorizations/rotate.js

heroku authorizations:update ID

updates an OAuth authorization

USAGE
  $ heroku authorizations:update ID [-d <value>] [--client-id <value>] [--client-secret <value>]

FLAGS
  -d, --description=<value>  set a custom authorization description
  --client-id=<value>        identifier of OAuth client to set
  --client-secret=<value>    secret of OAuth client to set

DESCRIPTION
  updates an OAuth authorization

See code: lib/commands/authorizations/update.js

heroku clients

list your OAuth clients

USAGE
  $ heroku clients [-j]

FLAGS
  -j, --json  output in json format

DESCRIPTION
  list your OAuth clients

See code: lib/commands/clients/index.js

heroku clients:create NAME REDIRECT_URI

create a new OAuth client

USAGE
  $ heroku clients:create NAME REDIRECT_URI [-s] [-j]

FLAGS
  -j, --json  output in json format
  -s, --shell  output in shell format

DESCRIPTION
  create a new OAuth client

See code: lib/commands/clients/create.js

heroku clients:destroy ID

delete client by ID

USAGE
  $ heroku clients:destroy ID

DESCRIPTION
  delete client by ID

See code: lib/commands/clients/destroy.js

heroku clients:info ID

show details of an oauth client

USAGE
  $ heroku clients:info ID [-j] [-s]

FLAGS
  -j, --json  output in json format
  -s, --shell  output in shell format

DESCRIPTION
  show details of an oauth client

See code: lib/commands/clients/info.js

heroku clients:rotate ID

rotate OAuth client secret

USAGE
  $ heroku clients:rotate ID [-j] [-s]

FLAGS
  -j, --json  output in json format
  -s, --shell  output in shell format

DESCRIPTION
  rotate OAuth client secret

See code: lib/commands/clients/rotate.js

heroku clients:update ID

update OAuth client

USAGE
  $ heroku clients:update ID [-n <value>] [--url <value>]

FLAGS
  -n, --name=<value>  change the client name
  --url=<value>       change the client redirect URL

DESCRIPTION
  update OAuth client

See code: lib/commands/clients/update.js

heroku sessions

list your OAuth sessions

USAGE
  $ heroku sessions [-j]

FLAGS
  -j, --json  output in json format

DESCRIPTION
  list your OAuth sessions

See code: lib/commands/sessions/index.js

heroku sessions:destroy ID

delete (logout) OAuth session by ID

USAGE
  $ heroku sessions:destroy ID

DESCRIPTION
  delete (logout) OAuth session by ID

See code: lib/commands/sessions/destroy.js

8.11.2

28 days ago

8.11.1

1 month ago

8.11.1-beta.6

1 month ago

8.11.0

2 months ago

8.11.0-beta.3

2 months ago

8.11.0-beta.1

2 months ago

8.11.0-beta.2

2 months ago

8.10.1-beta.0

2 months ago

8.11.0-beta.0

2 months ago

8.10.0

3 months ago

8.9.1-beta.0

3 months ago

8.6.0-beta.0

7 months ago

8.6.0

7 months ago

9.0.0-alpha.0

7 months ago

8.2.0-beta.0

9 months ago

9.0.0-dev.0

6 months ago

8.1.4-beta.0

12 months ago

8.1.8

11 months ago

8.1.9

11 months ago

8.1.4

12 months ago

8.0.5

1 year ago

8.1.0

1 year ago

8.0.5-beta.1

1 year ago

8.0.2

1 year ago

7.68.0

1 year ago

8.0.2-beta.1

1 year ago

8.0.2-beta.0

1 year ago

8.0.0

1 year ago

7.66.3

1 year ago

7.53.0

3 years ago

7.54.0

3 years ago

7.49.0

3 years ago

7.47.13

3 years ago

7.47.10

3 years ago

7.47.8

3 years ago

7.47.9

3 years ago

7.42.12

4 years ago

7.39.3

4 years ago

7.39.2

4 years ago

7.39.1

4 years ago

7.24.0

5 years ago

7.22.5

5 years ago

7.21.0

5 years ago

7.20.0

5 years ago

7.19.4

5 years ago

7.19.0

5 years ago

7.18.10

5 years ago

7.18.6

5 years ago

7.18.0

6 years ago

7.16.2

6 years ago

7.16.0

6 years ago

7.15.0

6 years ago

7.12.6

6 years ago

7.12.4

6 years ago

7.9.3

6 years ago

7.9.2

6 years ago

7.9.1

6 years ago

7.5.6

6 years ago

7.5.5

6 years ago

7.5.1

6 years ago

7.5.0

6 years ago

7.4.8

6 years ago

7.4.6

6 years ago

7.4.5

6 years ago

7.4.0

6 years ago

7.3.0

6 years ago

2.3.5

6 years ago