2016-05-23 18:07:59 -03:00
|
|
|
|
.. -*- rst -*-
|
|
|
|
|
|
2016-07-04 14:04:51 -07:00
|
|
|
|
===============
|
|
|
|
|
OS-OAUTH1 API
|
|
|
|
|
===============
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 09:59:51 -07:00
|
|
|
|
Provide the ability for identity users to delegate roles to third party
|
|
|
|
|
consumers via the `OAuth 1.0a specification <http://oauth.net/core/1.0a/>`__.
|
|
|
|
|
Requires v3.0+ of the Identity API. An OAuth-derived token will provide
|
|
|
|
|
a means of acting on behalf of the authorizing user.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 09:59:51 -07:00
|
|
|
|
Overview
|
|
|
|
|
========
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 09:59:51 -07:00
|
|
|
|
Definitions
|
|
|
|
|
-----------
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 09:59:51 -07:00
|
|
|
|
- *User:* An Identity API service user, the entity whose role(s) will be
|
|
|
|
|
delegated, and the entity that authorizes Request Tokens.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 09:59:51 -07:00
|
|
|
|
- *Request Token:* A token used by the Consumer to obtain authorization from
|
|
|
|
|
the User, and exchanged with an OAuth Verifier for an Access Token.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 09:59:51 -07:00
|
|
|
|
- *Access Token:* A token used by the Consumer to request new Identity API
|
|
|
|
|
tokens on behalf of the authorizing User, instead of using the User’s
|
|
|
|
|
credentials.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 09:59:51 -07:00
|
|
|
|
- *Token Key:* A key used by the token to identify itself. Both Request Tokens
|
|
|
|
|
and Access Tokens have Token Keys. For OpenStack purposes, the Token Key is
|
|
|
|
|
the Token ID.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 09:59:51 -07:00
|
|
|
|
- *Token Secret:* A secret used by the Consumer to establish ownership of a
|
|
|
|
|
given Token. Both Request Tokens and Access Tokens have Token Secrets.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 09:59:51 -07:00
|
|
|
|
- *OAuth Verifier:* A string that must be provided with the corresponding
|
|
|
|
|
Request Token in exchange for an Access Token.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 09:59:51 -07:00
|
|
|
|
Delegated Authentication Flow
|
|
|
|
|
-----------------------------
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 09:59:51 -07:00
|
|
|
|
Delegated Authentication via OAuth is done in five steps:
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 09:59:51 -07:00
|
|
|
|
#. An Identity API service User `creates a Consumer
|
|
|
|
|
<#create-consumer>`__.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 09:59:51 -07:00
|
|
|
|
#. The Consumer `obtains an unauthorized Request Token
|
|
|
|
|
<#create-request-token>`__.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 09:59:51 -07:00
|
|
|
|
#. The User `authorizes the Request Token
|
|
|
|
|
<#authorize-request-token>`__.
|
|
|
|
|
|
|
|
|
|
#. The Consumer `exchanges the Request Token for an Access Token
|
|
|
|
|
<#create-access-token>`__.
|
|
|
|
|
|
|
|
|
|
#. The Consumer `uses the Access Token to request an Identity API service Token
|
|
|
|
|
<#authenticate-with-identity-api>`__.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Create consumer
|
|
|
|
|
===============
|
|
|
|
|
|
|
|
|
|
.. rest_method:: POST /v3/OS-OAUTH1/consumers
|
|
|
|
|
|
|
|
|
|
Enables a user to create a consumer.
|
|
|
|
|
|
2016-07-13 19:38:13 +00:00
|
|
|
|
Normal response codes: 201
|
|
|
|
|
Error response codes: 413, 415, 405, 404, 403, 401, 400, 503, 409
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Request
|
|
|
|
|
-------
|
|
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
|
|
- description: description
|
|
|
|
|
|
|
|
|
|
Request Example
|
|
|
|
|
---------------
|
|
|
|
|
|
|
|
|
|
.. literalinclude:: ./samples/OS-OAUTH1/consumers-create-request.json
|
|
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Delete consumer
|
|
|
|
|
===============
|
|
|
|
|
|
|
|
|
|
.. rest_method:: DELETE /v3/OS-OAUTH1/consumers/{consumer_id}
|
|
|
|
|
|
|
|
|
|
Deletes a consumer.
|
|
|
|
|
|
|
|
|
|
When you delete a consumer, any associated request tokens, access
|
|
|
|
|
tokens, and Identity API tokens are also deleted.
|
|
|
|
|
|
|
|
|
|
Normal response codes: 204
|
|
|
|
|
Error response codes: 413, 415, 405, 404, 403, 401, 400, 503, 409
|
|
|
|
|
|
|
|
|
|
Request
|
|
|
|
|
-------
|
|
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
|
|
- consumer_id: consumer_id
|
|
|
|
|
|
|
|
|
|
|
2016-05-23 18:07:59 -03:00
|
|
|
|
List consumers
|
|
|
|
|
==============
|
|
|
|
|
|
|
|
|
|
.. rest_method:: GET /v3/OS-OAUTH1/consumers
|
|
|
|
|
|
|
|
|
|
Lists consumers.
|
|
|
|
|
|
|
|
|
|
Normal response codes: 200
|
2016-07-13 19:38:13 +00:00
|
|
|
|
Error response codes: 413, 405, 404, 403, 401, 400, 503
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Response Example
|
|
|
|
|
----------------
|
|
|
|
|
|
|
|
|
|
.. literalinclude:: ./samples/OS-OAUTH1/consumers-list-response.json
|
|
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Show consumer details
|
|
|
|
|
=====================
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
.. rest_method:: GET /v3/OS-OAUTH1/consumers/{consumer_id}
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Shows details for a consumer.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Normal response codes: 200
|
2016-07-13 19:38:13 +00:00
|
|
|
|
Error response codes: 413, 405, 404, 403, 401, 400, 503
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Request
|
|
|
|
|
-------
|
|
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
- consumer_id: consumer_id
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Response Example
|
|
|
|
|
----------------
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
.. literalinclude:: ./samples/OS-OAUTH1/consumer-show-response.json
|
2016-05-23 18:07:59 -03:00
|
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Update consumer
|
|
|
|
|
===============
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
.. rest_method:: PATCH /v3/OS-OAUTH1/consumers/{consumer_id}
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Updates the description for a consumer.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
If you try to update any attribute other than description, the HTTP
|
|
|
|
|
400 Bad Request error is returned.
|
|
|
|
|
|
|
|
|
|
Normal response codes: 200
|
2016-07-13 19:38:13 +00:00
|
|
|
|
Error response codes: 413, 415, 405, 404, 403, 401, 400, 503, 409
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Request
|
|
|
|
|
-------
|
|
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
- consumer_id: consumer_id
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Request Example
|
|
|
|
|
---------------
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
.. literalinclude:: ./samples/OS-OAUTH1/consumer-update-request.json
|
|
|
|
|
:language: javascript
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Response Example
|
|
|
|
|
----------------
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
.. literalinclude:: ./samples/OS-OAUTH1/consumer-update-response.json
|
2016-05-23 18:07:59 -03:00
|
|
|
|
:language: javascript
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Create request token
|
|
|
|
|
====================
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
.. rest_method:: POST /v3/OS-OAUTH1/request_token
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Enables a consumer to get an unauthorized request token.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Supported signature methods: HMAC-SHA1.
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
The consumer must provide all required OAuth parameters in the
|
|
|
|
|
request. See `Consumer Obtains a Request Token
|
2016-05-23 18:07:59 -03:00
|
|
|
|
<http://oauth.net/core/1.0a/#auth_step1>`_.
|
|
|
|
|
|
|
|
|
|
Normal response codes: 200
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Error response codes: 413, 415, 405, 404, 403, 401, 400, 503, 409
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Request
|
|
|
|
|
-------
|
|
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
- requested_project_id: requested_project_id
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Response Example
|
|
|
|
|
----------------
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
.. literalinclude:: ./samples/OS-OAUTH1/request-token-create-response.txt
|
2016-05-23 18:07:59 -03:00
|
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Authorize request token
|
|
|
|
|
=======================
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
.. rest_method:: POST /v3//OS-OAUTH1/authorize/{request_token_id}
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Request
|
|
|
|
|
-------
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
TBD
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Response Example
|
|
|
|
|
----------------
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
TBD
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Create access token
|
|
|
|
|
===================
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
.. rest_method:: POST /v3/OS-OAUTH1/access_token
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Enables a consumer to create an access token by exchanging a request token for an access token.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
After the user authorizes the request token, the consumer exchanges
|
|
|
|
|
the authorized request token and OAuth verifier for an access
|
|
|
|
|
token.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Supported signature methods: HMAC-SHA1.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
The consumer must provide all required OAuth parameters in the
|
|
|
|
|
request. See `Consumer Obtains a Request Token
|
|
|
|
|
<http://oauth.net/core/1.0a/#auth_step1>`_.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Supported signature methods: HMAC-SHA1.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
You must provide all required OAuth parameters in the request. See
|
|
|
|
|
`Consumer Obtains a Request Token
|
|
|
|
|
<http://oauth.net/core/1.0a/#auth_step1>`_.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Normal response codes: 200
|
|
|
|
|
Error response codes: 413, 415, 405, 404, 403, 401, 400, 503, 409
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Response Example
|
|
|
|
|
----------------
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
.. literalinclude:: ./samples/OS-OAUTH1/access-token-create-response.txt
|
|
|
|
|
:language: javascript
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Get authorized access token
|
|
|
|
|
===========================
|
|
|
|
|
|
|
|
|
|
.. rest_method:: GET /v3/OS-OAUTH1/users/{user_id}/access_tokens/{access_token_id}
|
|
|
|
|
|
|
|
|
|
Gets an authorized access token.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Normal response codes: 200
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Error response codes: 413, 405, 404, 403, 401, 400, 503
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Request
|
|
|
|
|
-------
|
|
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
- user_id: user_id
|
|
|
|
|
- access_token_id: access_token_id
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Response Example
|
|
|
|
|
----------------
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
.. literalinclude:: ./samples/OS-OAUTH1/access-token-show-response.json
|
2016-05-23 18:07:59 -03:00
|
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Revoke access token
|
|
|
|
|
===================
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
.. rest_method:: DELETE /v3/OS-OAUTH1/users/{user_id}/access_tokens/{access_token_id}
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Enables a user to revoke an access token, which prevents the consumer from
|
|
|
|
|
requesting new Identity Service API tokens. Also, revokes any Identity Service
|
|
|
|
|
API tokens that were issued to the consumer through that access token.
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Normal response codes: 204
|
2016-07-13 19:38:13 +00:00
|
|
|
|
Error response codes: 413, 415, 405, 404, 403, 401, 400, 503, 409
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Request
|
|
|
|
|
-------
|
|
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
- user_id: user_id
|
|
|
|
|
- access_token_id: access_token_id
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
List authorized access tokens
|
|
|
|
|
=============================
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
.. rest_method:: GET /v3/OS-OAUTH1/users/{user_id}/access_tokens
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Lists authorized access tokens.
|
2016-07-14 09:59:51 -07:00
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
Normal response codes: 200
|
|
|
|
|
Error response codes: 413, 405, 404, 403, 401, 400, 503
|
2016-07-14 09:59:51 -07:00
|
|
|
|
|
|
|
|
|
Request
|
|
|
|
|
-------
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
|
|
- user_id: user_id
|
2016-07-14 09:59:51 -07:00
|
|
|
|
|
|
|
|
|
Response Example
|
|
|
|
|
----------------
|
|
|
|
|
|
2016-07-14 10:06:29 -07:00
|
|
|
|
.. literalinclude:: ./samples/OS-OAUTH1/access-tokens-list-response.json
|
|
|
|
|
:language: javascript
|
2016-07-14 09:59:51 -07:00
|
|
|
|
|
|
|
|
|
|
2016-05-23 18:07:59 -03:00
|
|
|
|
List roles for an access token
|
|
|
|
|
==============================
|
|
|
|
|
|
|
|
|
|
.. rest_method:: GET /v3/OS-OAUTH1/users/{user_id}/access_tokens/{access_token_id}/roles
|
|
|
|
|
|
|
|
|
|
Lists associated roles for an access token.
|
|
|
|
|
|
|
|
|
|
Normal response codes: 200
|
2016-07-13 19:38:13 +00:00
|
|
|
|
Error response codes: 413, 415, 405, 404, 403, 401, 400, 503
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Request
|
|
|
|
|
-------
|
|
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
|
|
- user_id: user_id
|
|
|
|
|
- access_token_id: access_token_id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Show role details for an access token
|
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
|
|
.. rest_method:: GET /v3/OS-OAUTH1/users/{user_id}/access_tokens/{access_token_id}/roles/{role_id}
|
|
|
|
|
|
|
|
|
|
Shows details for a role for an access token.
|
|
|
|
|
|
|
|
|
|
Normal response codes: 200
|
2016-07-13 19:38:13 +00:00
|
|
|
|
Error response codes: 413, 415, 405, 404, 403, 401, 400, 503
|
2016-05-23 18:07:59 -03:00
|
|
|
|
|
|
|
|
|
Request
|
|
|
|
|
-------
|
|
|
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
|
|
- user_id: user_id
|
|
|
|
|
- role_id: role_id
|
|
|
|
|
- access_token_id: access_token_id
|
2016-07-14 10:06:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authenticate with Identity API
|
|
|
|
|
==============================
|
|
|
|
|
|
|
|
|
|
.. rest_method:: POST /v3/auth/tokens
|
|
|
|
|
|
|
|
|
|
Enables a consumer to get an Identity Service authentication token.
|
|
|
|
|
|
|
|
|
|
The token represents the delegated authorization and identity
|
|
|
|
|
(impersonation) of the authorizing user. The roles and scope of the
|
|
|
|
|
generated token match those that the consumer initially requested.
|
|
|
|
|
|
|
|
|
|
Supported signature methods: HMAC-SHA1.
|
|
|
|
|
|
|
|
|
|
The consumer must provide required OAuth parameters in the request.
|
|
|
|
|
See `Consumer Obtains a Request Token
|
|
|
|
|
<http://oauth.net/core/1.0a/#auth_step1>`_.
|
|
|
|
|
|
|
|
|
|
The returned token is scoped to the requested project and with the
|
|
|
|
|
requested roles. In addition to the standard token response, the
|
|
|
|
|
token has an OAuth-specific object.
|
|
|
|
|
|
|
|
|
|
Example OAuth-specific object in a token:
|
|
|
|
|
|
|
|
|
|
.. code-block:: json
|
|
|
|
|
|
|
|
|
|
"OS-OAUTH1": {
|
|
|
|
|
"access_token_id": "cce0b8be7"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Normal response codes: 200
|
|
|
|
|
Error response codes: 413, 405, 404, 403, 401, 400, 503
|