':param query: The request
:param binding_in: Which binding was used when receiving the query
:param relay_state: The relay state provided by the SP
:param encrypt_cert: Cert to use for encryption
:return: A response'

def do(self, query, binding_in, relay_state='', encrypt_cert=None):

    try:
        (resp_args, _resp) = self.verify_request(query, binding_in)
    except UnknownPrincipal as excp:
        logger.error(('UnknownPrincipal:    %s' % (excp,)))
        resp = ServiceError(('UnknownPrincipal:    %s' % (excp,)))
        return resp(self.environ, self.start_response)
    except UnsupportedBinding as excp:
        logger.error(('UnsupportedBinding:    %s' % (excp,)))
        resp = ServiceError(('UnsupportedBinding:    %s' % (excp,)))
        return resp(self.environ, self.start_response)
    if (not _resp):
        identity = USERS[self.user].copy()
        logger.info(('Identity:    %s' % (identity,)))
        if REPOZE_ID_EQUIVALENT:
            identity[REPOZE_ID_EQUIVALENT] = self.user
        try:
            try:
                metod = self.environ['idp.authn']
            except KeyError:
                pass
            else:
                resp_args['authn'] = metod
            _resp = IDP.create_authn_response(identity, userid=self.user, encrypt_cert=encrypt_cert, **resp_args)
        except Exception as excp:
            logging.error(exception_trace(excp))
            resp = ServiceError(('Exception:    %s' % (excp,)))
            return resp(self.environ, self.start_response)
    logger.info(('AuthNResponse:    %s' % _resp))
    if (self.op_type == 'ecp'):
        kwargs = {'soap_headers': [ecp.Response(assertion_consumer_service_url=self.destination)]}
    else:
        kwargs = {}
    http_args = IDP.apply_binding(self.binding_out, ('%s' % _resp), self.destination, relay_state, response=True, **kwargs)
    logger.debug(('HTTPargs:    %s' % http_args))
    return self.response(self.binding_out, http_args)
