From 99a21516ad099812cd79d4ab3e3f2a6af0939049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20L=C3=B3pez-Doriga?= Date: Tue, 28 Nov 2023 09:24:39 +0100 Subject: [PATCH] fixing username auth utils --- beacon/utils/auth.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/beacon/utils/auth.py b/beacon/utils/auth.py index 6784bc15..36c8f7c2 100644 --- a/beacon/utils/auth.py +++ b/beacon/utils/auth.py @@ -44,9 +44,12 @@ async def resolve_token(token, requested_datasets_ids): content_splitted= content.split(':') authorized_datasets = content_splitted[-1] authorized_datasets_list = authorized_datasets.split('"') - username_ = content_splitted[1] - username_list = username_.split('"') - username = username_list[1] + try: + username_ = content_splitted[1] + username_list = username_.split('"') + username = username_list[1] + except Exception: + username = '' LOG.debug(username) auth_datasets = [] for auth_dataset in authorized_datasets_list: