Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Obtaining an Authentication Token to Work with the Network Activator APIs

    You must obtain an authentication token from the Keystone Authentication Server on the central server before you work with the Network Activator APIs. When you have obtained the token, you can store it and use it for all future operations with the Network Activator API.

    This procedure uses the following Keystone Authentication Server API:

    Table 1 shows the fields that you must specify for this procedure.

    Table 1: Required Fields for Obtaining a Token to Work with Network Activator APIs




    auth: tenantName

    Tenant name—admin (fixed text string)


    passwordCredentials: username

    Username—admin (fixed text string)


    passwordCredentials: password

    Password for accessing the API server


    To obtain a token:

    1. Issue a REST call to get a token.

      The API returns a token.
      For example:

      user@host:~$ curl -kd '{"auth":{"tenantName":"admin", "passwordCredentials":{"username":"admin", "password":"contrail123"}}}' -H "Content-type: application/json"
      {"access": {"token": {"issued_at": "2016-03-06T06:49:38.245074", "expires": "2016-03-06T07:49:38Z", "id": "MIIGHgYJKoZIhvcNAQcCoIIGDzCCBgsCAQE-YLa1fos0wsAnO5zYw==", "tenant": {"description": "Admin Tenant", "enabled": true, "id": "0b372a0338a743c1b127fbd99d90b95c", "name": "admin"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "", "region": "regionOne", "internalURL": "", "id": "50609049e5204ddcadb511487bd75ec1", "publicURL": ""}, {"adminURL": "", "region": "central", "internalURL": "", "id": "4cbb5018d5344e7f9f9ef7508154b15c", "publicURL": ""}], "endpoints_links": [], "type": "object-store", "name": "swift"}], "user": {"username": "admin", "roles_links": [], "id": "53bc145e1ad84a71a704a62201fd4468", "roles": [{"name": "admin"}], "name": "admin"}, "metadata": {"is_admin": 0, "roles": ["fbaff5e3b77049f2ac559ae96888f585"]}}}

      Note: The token is typically an extremely long sequence, and these examples show a shorter sequence, which is easier to read.

    2. Store the token in an environment variable so that you can use it for subsequent API operations.
      For example:
      user@host:~$ export OS_TOKEN=MIIGHgYJKoZIhvcNAQcCoIIGDzCCBgsCAQE-YLa1fos0wsAnO5zYw==
      user@host:~$ echo $OS_TOKEN

    Modified: 2016-10-19