def parse_response(self, info, sformat="", state="", **kwargs):
        """
        This the start of a pipeline that will:

            1 Deserializes a response into it's response message class.
              Or :py:class:`oidcmsg.oauth2.ErrorResponse` if it's an error
              message
            2 verifies the correctness of the response by running the
              verify method belonging to the message class used.
            3 runs the do_post_parse_response method iff the response was not
              an error response.

        :param info: The response, can be either in a JSON or an urlencoded
            format
        :param sformat: Which serialization that was used
        :param state: The state
        :param kwargs: Extra key word arguments
        :return: The parsed and to some extend verified response
        """

        if not sformat:
            sformat = self.response_body_type

        logger.debug('response format: {}'.format(sformat))

        if sformat in ['jose', 'jws', 'jwe']:
            resp = self.post_parse_response(info, state=state)

            if not resp:
                logger.error('Missing or faulty response')
                raise ResponseError("Missing or faulty response")

            return resp

        # If format is urlencoded 'info' may be a URL
        # in which case I have to get at the query/fragment part
        if sformat == "urlencoded":
            info = self.get_urlinfo(info)

        if sformat == 'jwt':
            args = {'allowed_sign_algs':
                        self.service_context.get_sign_alg(self.service_name)}
            enc_algs = self.service_context.get_enc_alg_enc(self.service_name)
            args['allowed_enc_algs'] = enc_algs['alg']
            args['allowed_enc_encs'] = enc_algs['enc']
            _jwt = JWT(key_jar=self.service_context.keyjar, **args)
            _jwt.iss = self.service_context.client_id
            info = _jwt.unpack(info)
            sformat = "dict"

        logger.debug('response_cls: {}'.format(self.response_cls.__name__))
        try:
            resp = self.response_cls().deserialize(
                info, sformat, iss=self.service_context.issuer, **kwargs)
        except Exception as err:
            resp = None
            if sformat == 'json':
                # Could be JWS or JWE but wrongly tagged
                # Adding issuer is just a fail-safe. If one things was wrong
                # then two can be.
                try:
                    resp = self.response_cls().deserialize(
                        info, 'jwt', iss=self.service_context.issuer, **kwargs)
                except Exception as err2:
                    pass

            if resp is None:
                logger.error('Error while deserializing: {}'.format(err))
                raise

        msg = 'Initial response parsing => "{}"'
        logger.debug(msg.format(resp.to_dict()))

        # is this an error message
        if is_error_message(resp):
            logger.debug('Error response: {}'.format(resp))
        else:
            vargs = self.gather_verify_arguments()
            logger.debug("Verify response with {}".format(vargs))
            try:
                # verify the message. If something is wrong an exception is
                # thrown
                resp.verify(**vargs)
            except Exception as err:
                logger.error(
                    'Got exception while verifying response: {}'.format(err))
                raise

            resp = self.post_parse_response(resp, state=state)

        if not resp:
            logger.error('Missing or faulty response')
            raise ResponseError("Missing or faulty response")

        return resp
This the start of a pipeline that will:

            1 Deserializes a response into it's response message class.
              Or :py:class:`oidcmsg.oauth2.ErrorResponse` if it's an error
              message
            2 verifies the correctness of the response by running the
              verify method belonging to the message class used.
            3 runs the do_post_parse_response method iff the response was not
              an error response.

        :param info: The response, can be either in a JSON or an urlencoded
            format
        :param sformat: Which serialization that was used
        :param state: The state
        :param kwargs: Extra key word arguments
        :return: The parsed and to some extend verified response