From 64b179cc0beef0269f18069e4cc3bdd5a0c6cd17 Mon Sep 17 00:00:00 2001 From: Giulia Naponiello Date: Feb 05 2019 16:56:06 +0000 Subject: Improve authentication error response When using Kerberos authentication it is necessary to configure "dns_canonicalize_hostname" inside the Kerberos configuration file otherwise the user will get an error response that is a bit ambiguous. There's no way to detect if that was the problem or it is just a generic authentication error. But we can provide an hint to the user, and also advise to check the doc. --- diff --git a/waiverdb/cli.py b/waiverdb/cli.py index 59b867d..a233c25 100644 --- a/waiverdb/cli.py +++ b/waiverdb/cli.py @@ -279,7 +279,10 @@ def cli(comment, waived, product_version, testcase, subject, subject_identifier, 'POST', url, auth=auth, **common_request_arguments) if resp.status_code == 401: raise click.ClickException('WaiverDB authentication using GSSAPI failed. ' - 'Make sure you have a valid Kerberos ticket.') + 'Make sure you have a valid Kerberos ticket or ' + 'that you correctly configured your Kerberos ' + 'configuration file. Please check the doc for ' + 'troubleshooting information.') check_response(resp, result_ids) elif auth_method == 'dummy': resp = requests.request(