Get the authentication header.

        If the current session has not been authenticated, this will trigger a
        new authentication to the HubiC OAuth service.

        :param keystoneclient.Session session: The session object to use for
                                               queries.

        :raises keystoneclient.exceptions.AuthorizationFailure: if something
                                                                goes wrong.

        :returns: The headers used for authenticating requests.
        :rtype: dict

def get_headers(self, session, **kwargs):
        """Get the authentication header.

        If the current session has not been authenticated, this will trigger a
        new authentication to the HubiC OAuth service.

        :param keystoneclient.Session session: The session object to use for
                                               queries.

        :raises keystoneclient.exceptions.AuthorizationFailure: if something
                                                                goes wrong.

        :returns: The headers used for authenticating requests.
        :rtype: dict
        """

        if self.auth_token is None:
            try:
                self._refresh_tokens(session)
                self._fetch_credentials(session)
            except:
                raise AuthorizationFailure()

        return {
            'X-Auth-Token': self.auth_token,
        }