Session Token Export
A method to execute OpenStack commands via CLI/API (without password) is with a valid session token. To export this, please proceed as follows:
- Log in to Horizon
- Now in the OpenStack Management, click the small arrow in the top right corner next to Account Management and select Export credentials
- Now select the desired Credential Type and the Export Format and click the Copy to clipboard button.
- 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="<client-project-name>"
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="xxxxxxxxxxxxxxxxxxxxxxxxxxx"
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
Current User Session Tokens are only valid until their defined expiration (typically 24h).