At some point, code to get a token based on the Users/loginmethod was changed to use urllib rather than string concatenation. urllib has a some deceptive behavior, however, based on whether the base url has a trailing slash or not.
|
urljoin(base_url, "Users/login"), |
Observe the following:
urljoin("https://scicat/api/v3", "Users/login")
'https://scicat/api/Users/login' <--- bad URL
urljoin("https://scicatv/api/v3/", "Users/login")
'https://scicat/api/v3/Users/login' <-- good URL
So, if the caller does not add a trailing slash, urllib will produce a URL that fails to let the login work. This gets a little tricky, too, because the code silently fails tried msad auth, which on my system also fails.
We should maybe add code before using urllib to check for a trailing slash
At some point, code to get a token based on the
Users/loginmethod was changed to useurllibrather than string concatenation.urllibhas a some deceptive behavior, however, based on whether the base url has a trailing slash or not.pyscicat/pyscicat/client.py
Line 953 in 03e0628
Observe the following:
So, if the caller does not add a trailing slash, urllib will produce a URL that fails to let the login work. This gets a little tricky, too, because the code silently fails tried msad auth, which on my system also fails.
We should maybe add code before using urllib to check for a trailing slash