IAM Token Manager

The IAM Token Manager manages IAM access tokens and refreshes them before they expire. Currently only IBM IAM tokens are supported.

demo

Prerequisites

Install the current stable release of Rust by using rustup. On Linux & OS X this can be done by running:

curl https://sh.rustup.rs -sSf | sh

IBM

Compile the ibmtest example binary by executing the following in the repo root:

cargo build --example ibmtest

The compiled binary ibmtest can be found in target/debug/examples/.

The binary has the following command line flags

At least one of --ibm or --ibm-test needs to be specified. If web.listen-port is specified, a web server is started that exposes the following routes:

{ tokens": [ { "id": "274a00...", "access_token": "eyJraW...", "refresh_token": "eyJraW..." } ] }

{ "id": "247a00...", "access_token": "eyJraW...", "refresh_token": "eyJraW..." }

Example (replace with real API keys):

The environment variable RUST_LOG controls the logging output detail. Not setting this environment variable means that only errors will be logged:

RUST_LOG=info ./target/debug/examples/ibmtest --ibm <key1> --ibm <key2> --ibm-test <key3> --web.listen.port=5050