'Authenticate mapped user and set an authentication context.
:param request: keystone\'s request context
:param auth_payload: the content of the authentication for a
given method
In addition to ``user_id`` in ``response_data``, this plugin sets
``group_ids``, ``OS-FEDERATION:identity_provider`` and
``OS-FEDERATION:protocol``'

def authenticate(self, request, auth_payload):

    if ('id' in auth_payload):
        token_ref = self._get_token_ref(auth_payload)
        response_data = handle_scoped_token(request, token_ref, self.federation_api, self.identity_api)
    else:
        response_data = handle_unscoped_token(request, auth_payload, self.resource_api, self.federation_api, self.identity_api, self.assignment_api, self.role_api)
    return base.AuthHandlerResponse(status=True, response_body=None, response_data=response_data)
