'Use REMOTE_USER to look up the user in the identity backend.
The user_id from the actual user from the REMOTE_USER env variable is
placed in the response_data.'

def authenticate(self, request, auth_payload):

    response_data = {}
    if (not request.remote_user):
        msg = _('No    authenticated    user')
        raise exception.Unauthorized(msg)
    try:
        user_ref = self._authenticate(request)
    except Exception:
        msg = (_('Unable    to    lookup    user    %s') % request.remote_user)
        raise exception.Unauthorized(msg)
    response_data['user_id'] = user_ref['id']
    auth_type = (request.auth_type or '').lower()
    if (('kerberos' in CONF.token.bind) and (auth_type == 'negotiate')):
        response_data.setdefault('bind', {})['kerberos'] = user_ref['name']
    return base.AuthHandlerResponse(status=True, response_body=None, response_data=response_data)
