Receiving token

Token is need for receiving access to controller. No REST API requests are possible without token.

Methods of getting token

Note

All parameters in commands are example, replace them with actual parameters when using.

  1. Receiving by requesting an API using curl.

    Command:

    curl -i \
    -H "Content-Type: application/json" \
    -d '
    { "auth": {
    "identity": {
    "methods": ["password"],
    "password": {
    "user": {
    "name": "admin",
    "domain": { "name": "default" },
    "password": "adminpwd"
    }
    }
    }
    }
    }' \
    http://controller:5000/v3/auth/tokens ; echo
    
  2. Receiving token by console utility Openstack Client.

    Command:

    openstack --os-auth-url http://controller:5000/v3   --os-project-domain-name default --os-user-domain-name default   --os-project-name admin --os-username admin token issue
    

Methods of getting token

Tokens for project are intended for work permission within specific project. Tokens content a service catalog, a set of roles and detailed information about the project in which the permit is issued.

Note

All parameters in commands are example, replace them with actual parameters when using.

  1. Receiving token for project by requesting an API using curl.

    Command:

    curl -i \
    -H "Content-Type: application/json" \
    -d '
    { "auth": {
    "identity": {
    "methods": ["password"],
    "password": {
    "user": {
    "name": "admin",
    "domain":
    { "name": "default" }
    ,
    "password": "adminpwd"
    }
    }
    },
    "scope": {
    "project": {
    "name": "demo",
    "domain":
    { "name": "default" }
    }
    }
    }
    }' \
    "http://controller:5000/v3/auth/tokens" ; echo
    
  2. Receiving token for project by console utility Openstack Client.

    Command:

    openstack --os-username=admin --os-user-domain-name=default --os-password=123456 --os-project-name=admin --os-project-domain-name=default token issue