Clarify token_endpoint.Token usecases

This authentication plugin isn't grouped with the other authentication
plugins, but it can be really useful for people writing proxies or
implementing service-to-service calls.

This commit just highlights the usefulness of this plugin with some
example usecases and a code snippet. The current documentation phrases
it such that it's only useful for testing.

Change-Id: I1de4959ccde3fdf8141d8f4949c73542c2200483
This commit is contained in:
Lance Bragstad 2021-01-08 21:55:07 +00:00
parent 6a662719ce
commit b8ddb3b75f
1 changed files with 13 additions and 3 deletions

View File

@ -321,12 +321,22 @@ Simple Plugins
--------------
In addition to the Identity plugins a simple plugin that will always use the
same provided token and endpoint is available. This is useful in situations
where you have an token or in testing when you specifically know the endpoint
you want to communicate with.
same provided token and endpoint is available. This is useful for situations
where you have a token and want to bypass authentication to obtain a new token
for subsequent requests. Testing, proxies, and service-to-service
authentication on behalf of a user are good examples use cases for this
authentication plugin.
It can be found at :py:class:`keystoneauth1.token_endpoint.Token`.
For example::
>>> from keystoneauth1 import token_endpoint
>>> from keystoneauth1 import session
>>> a = token_endpoint.Token('http://my.keystone.com:5000/v3',
... token=token)
>>> s = session.Session(auth=a)
V3 OAuth 1.0a Plugins
---------------------