diff --git a/hbp_nrp_virtual_coach/hbp_nrp_virtual_coach/virtual_coach.py b/hbp_nrp_virtual_coach/hbp_nrp_virtual_coach/virtual_coach.py index bedf6a3cb09b788cb46de83dcb2f24e216fb8c4a..bd67c814e7a7dd3a300268e84ba6ff174a2f3022 100644 --- a/hbp_nrp_virtual_coach/hbp_nrp_virtual_coach/virtual_coach.py +++ b/hbp_nrp_virtual_coach/hbp_nrp_virtual_coach/virtual_coach.py @@ -386,15 +386,16 @@ class VirtualCoach(object): assert isinstance(cloned, bool) logger.info('Retrieving list of experiments.') + headers = None if self.__oidc_username else self.__storage_headers if cloned: url = self.__config['proxy-services']['storage-experiment-list'] - response = requests.get(url, headers=self.__storage_headers) + response = requests.get(url, headers=headers) # return a simple list containing only experiment names since this is the only # information in the dictionary anyway return [experiment['name'] for experiment in json.loads(response.content)] else: _, response = self.__oidc_client.request( - self.__config['proxy-services']['experiment-list']) + self.__config['proxy-services']['experiment-list'], headers=headers) return json.loads(response) def __get_available_server_list(self):