def dynamic_client(self, userid='', issuer=''):
        client = self.client_cls(client_authn_method=CLIENT_AUTHN_METHOD,
                                 verify_ssl=self.verify_ssl, **self.jwks_info)

        if userid:
            issuer = client.wf.discovery_query(userid)

        if not issuer:
            raise OIDCError('Missing issuer')

        logger.info('issuer: {}'.format(issuer))
        if issuer in self.client:
            return self.client[issuer]
        else:
            # Gather OP information
            _pcr = client.provider_config(issuer)
            logger.info('Provider info: {}'.format(_pcr.to_dict))
            # register the client
            _cinfo = self.config.CLIENTS[""]["client_info"]
            reg_args = copy.copy(_cinfo)
            h = hashlib.sha256(self.seed)
            h.update(issuer.encode('utf8'))  # issuer has to be bytes
            base_urls = _cinfo["redirect_uris"]

            reg_args['redirect_uris'] = [
                u.format(base=self.base_url, iss=h.hexdigest())
                for u in base_urls]
            try:
                reg_args['post_logout_redirect_uris'] = [
                    u.format(base=self.base_url, iss=h.hexdigest())
                    for u in reg_args['post_logout_redirect_uris']
                    ]
            except KeyError:
                pass

            self.get_path(reg_args['redirect_uris'], issuer)
            if client.jwks_uri:
                reg_args['jwks_uri'] = client.jwks_uri

            rr = client.register(_pcr["registration_endpoint"], **reg_args)
            logger.info('Registration response: {}'.format(rr.to_dict()))

            try:
                client.behaviour.update(**self.config.CLIENTS[""]["behaviour"])
            except KeyError:
                pass

            self.client[issuer] = client
            return client
dataset/ETHPy150Open rohe/pyoidc/src/oic/utils/rp/__init__.py/OIDCClients.dynamic_client/original