Skip to content

Commit

Permalink
Add docs for OCM_CONFIG
Browse files Browse the repository at this point in the history
  • Loading branch information
mmazur committed Jan 16, 2020
1 parent aa6db48 commit 8219a4a
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= OCM API Command Line Tools

This project contains the `ocm` command line tool that simplifies the use
of the _OCM_ API available in `api.openshift.com`.
of the _OCM_ API available at `api.openshift.com`.

== Installation

Expand Down Expand Up @@ -74,6 +74,26 @@ $ ocm login \
NOTE: The `insecure` option disables verification of TLS certificates and host
names, do not use it in production environments.

== Multiple Concurrent Logins with OCM_CONFIG

An `.ocm.json` file stores login credentials for a single API gateway.
Using multiple gateways therefore requires having to log in and out a lot or the ability to utilize multiple config files.
The latter functionality is provided with the `OCM_CONFIG` environment variable.
If running `ocm login` was successfull in both cases, the `ocm whoami` commands will return different results:

....
$ OCM_CONFIG=$HOME/.ocm.json.prod ocm login --url=production --token=...
(…)
$ OCM_CONFIG=$HOME/.ocm.json.stg ocm login --url=staging --token=...
(…)
$ OCM_CONFIG=$HOME/.ocm.json.prod ocm whoami
(…)
$ OCM_CONFIG=$HOME/.ocm.json.stg ocm whoami
(…)
....

NOTE: Tokens for production and staging will differ.

== Obtaining Tokens

If you need the _OpenID_ access token to use it with some other tool, you can
Expand Down

0 comments on commit 8219a4a

Please sign in to comment.