From b8ddb3b75f223b0cc47c24d1ae35aeee0fa37cf4 Mon Sep 17 00:00:00 2001 From: Lance Bragstad Date: Fri, 8 Jan 2021 21:55:07 +0000 Subject: [PATCH] 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 --- doc/source/authentication-plugins.rst | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/source/authentication-plugins.rst b/doc/source/authentication-plugins.rst index 086e4839..f103ea57 100644 --- a/doc/source/authentication-plugins.rst +++ b/doc/source/authentication-plugins.rst @@ -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 ---------------------