How to export the current Session Token

One method to run OpenStack commands via CLI/API (without password) is with a valid session token. To export this, please proceed as follows:

../_images/export-cr1.png
  • Now select the desired Credential Type and the Export Format and click on the Copy to clipboard button.
../_images/export-cr2.png
  • Now paste the credentials from the clipboard into your bash terminal.
# Paste credentials to terminal
export OS_AUTH_URL=https://keystone.service.ewcs.ch/v3
export OS_PROJECT_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxx
export OS_PROJECT_NAME="clienta-os-pr1"
export OS_PROJECT_DOMAIN_ID="xxxxxxxxxxxxxxxxxxxxxxxxxxx"
if [ -z "$OS_PROJECT_DOMAIN_ID" ]; then unset OS_PROJECT_DOMAIN_ID; fi
unset OS_TENANT_ID
unset OS_TENANT_NAME
export OS_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export OS_REGION_NAME="ch-zh1"
if [ -z "$OS_REGION_NAME" ]; then unset OS_REGION_NAME; fi
export OS_INTERFACE=public
export OS_IDENTITY_API_VERSION=3
export OS_AUTH_PLUGIN=token
export OS_AUTH_TYPE=token

Note

The current User Session Token are only valid until their defined expiration (usually 24h).