Exchange cURL examples for openstackclient

python-openstackclient is friendlier than cURL and is able to handle
listing resources available to federated users as well as scoping
unscoped tokens, so let's use openstackclient in the examples for
performing federated authentication.

Change-Id: Ie4578d4a371b50ad8c2b2a6836caba580c120cd4
This commit is contained in:
Colleen Murphy 2017-02-27 10:21:28 +01:00 committed by Colleen Murphy
parent f73a2924f8
commit f5649079bb

View File

@ -367,19 +367,25 @@ projects and domains that are accessible.
Read more about `listing resources
<https://developer.openstack.org/api-ref/identity/v3-ext/#list-projects-a-federated-user-can-access>`__.
~~~~~~~~~~~~
Example cURL
~~~~~~~~~~~~
~~~~~~~
Example
~~~~~~~
.. code-block:: bash
$ curl -X GET -H "X-Auth-Token: <unscoped token>" http://localhost:5000/v3/OS-FEDERATION/projects
$ export OS_IDENTITY_API_VERSION=3
$ export OS_TOKEN=<unscoped token>
$ export OS_URL=http://localhost:5000/v3
$ openstack federation project list
or
.. code-block:: bash
$ curl -X GET -H "X-Auth-Token: <unscoped token>" http://localhost:5000/v3/OS-FEDERATION/domains
$ export OS_IDENTITY_API_VERSION=3
$ export OS_TOKEN=<unscoped token>
$ export OS_URL=http://localhost:5000/v3
$ openstack federation domain list
Get a scoped token
~~~~~~~~~~~~~~~~~~
@ -391,13 +397,19 @@ sufficient to uniquely identify a project or domain.
Read more about `getting a scoped token
<https://developer.openstack.org/api-ref/identity/v3-ext/#request-a-scoped-os-federation-token>`__.
~~~~~~~~~~~~
Example cURL
~~~~~~~~~~~~
~~~~~~~
Example
~~~~~~~
.. code-block:: bash
$ curl -X POST -H "Content-Type: application/json" -d '{"auth":{"identity":{"methods":["mapped"],"mapped":{"id":"<unscoped_token_id>"}},"scope":{"project":{"domain": {"name": "federated_domain"},"name":"federated_project"}}}}' -D - http://localhost:5000/v3/auth/tokens
$ export OS_AUTH_TYPE=token
$ export OS_IDENTITY_API_VERSION=3
$ export OS_TOKEN=<unscoped token>
$ export OS_AUTH_URL=http://localhost:5000/v3
$ export OS_PROJECT_DOMAIN_NAME=federated_domain
$ export OS_PROJECT_NAME=federated_project
$ openstack token issue
--------------------------------------
Keystone as an Identity Provider (IdP)