AuthHandler
class AuthHandler
This class is responsible for three tasks:
- performing the initial authentication for OpenStack services
- populating the
X-Auth-Token
header for every HTTP request - checking the token expiry before each request, and re-authenticating if necessary
Methods
__construct
(callable $nextHandler, callable $tokenGenerator, Token $token = null)
No description
__invoke
(RequestInterface $request, array $options)
: mixed|void
This method is invoked before every HTTP request is sent to the API. When this happens, it
checks to see whether a token is set and valid, and then sets the X-Auth-Token
header
for the HTTP request before letting it continue on its merry way.