name = Runnable Token Bootstrap Example
description = Demonstrates bearer token capture and downstream reuse with Lorem API's mock JWT endpoint.
$ API_ORIGIN = https://lorem-api.com/api
$ API_TOKEN_TYPE = Bearer
---
Issue mock bearer token
POST {{ API_ORIGIN }}/jwt
~~~ application/json
{
"username": "hen-client",
"password": "demo-password",
"role": "service"
}
~~~
& body.token -> $API_ACCESS_TOKEN
^ & status == 200
^ $API_ACCESS_TOKEN ~= /[A-Za-z0-9_.-]+/
---
Reuse bearer token downstream
POST {{ API_ORIGIN }}/echo
* Authorization = {{ API_TOKEN_TYPE }} {{ API_ACCESS_TOKEN }}
* X-Token-Type = {{ API_TOKEN_TYPE }}
~~~ application/json
{
"client": "hen-cli",
"grant": "bootstrap"
}
~~~
^ & status == 200
^ & body.client == "hen-cli"