Token-based Authentication Middleware
This WSGI component:
Refer to: http://docs.openstack.org/developer/keystonemiddleware/middlewarearchitecture.html
The auth_token middleware uses headers sent in by the client on the request and sets headers and environment variables for the downstream WSGI component.
When using composite authentication (a user and service token are present) additional service headers relating to the service user will be added. They take the same form as the standard headers but add ‘_SERVICE_’. These headers will not exist in the environment if no service token is present.
json encoded service catalog (optional). For compatibility reasons this catalog will always be in the V2 catalog format even if it is a v3 token.
These variables are set in the request environment for use by the downstream WSGI component.
Middleware configuration can be in the main application’s configuration file, e.g. in nova.conf:
[keystone_authtoken]
auth_plugin = password
auth_url = http://keystone:35357/
username = nova
user_domain_id = default
password = whyarewestillusingpasswords
project_name = service
project_domain_id = default
Configuration can also be in the api-paste.ini file with the same options, but this is discouraged.
When deploy Keystone auth_token middleware with Swift, user may elect to use Swift memcache instead of the local auth_token memcache. Swift memcache is passed in from the request environment and it’s identified by the swift.cache key. However it could be different, depending on deployment. To use Swift memcache, you must set the cache option to the environment key where the Swift cache object is stored.
Bases: keystonemiddleware.auth_token._BaseAuthProtocol
Middleware that handles authenticating client calls.
Process request.
Evaluate the headers in a request and attempt to authenticate the request against the identity server. If authenticated then additional headers are added to the request for use by applications. If not authenticated the request will be rejected or marked unauthenticated depending on configuration.
Process Response.
Add WWW-Authenticate headers to failed requests so users know where to authenticate for future requests.
Returns a WSGI filter app for use with paste.deploy.