In case anyone ever wonders about the same question, it’s possible to establish a session in two steps:
- You can authorize the session and get the credentials your client will need to authenticate (this is just an example for db creds but should be similar for kubernetes):
$ OUTPUT=$(boundary targets authorize-session -id ttcp_DB********w5 -format json)
$ echo $OUTPUT | jq -r '.item.credentials[].secret.decoded'
{
"password": "REDACTED",
"username": "v-token-to-target-nfZzom*************9528811"
}
From the same output you need to get the authorization_token
:
$ AUTHZ_TOKEN=$(echo $OUTPUT | jq -r '.item.authorization_token')
- You can then establish the connection using the above token:
$ LISTEN_PORT=<choose yours>
$ boundary connect -listen-port $LISTEN_PORT -authz-token $AUTHZ_TOKEN