Everything works fine when I access the /files endpoint from a browser after logging in via the webserver. However, when I run an experiment using the ClearML Python package and it tries to upload the artifacts to the /files endpoint, it gets blocked with a 401 Unauthorized error.
I’ve checked the ClearML Python package and it seems to be attaching the auth headers correctly. However, the JWT token it’s using is different from the one used by the browser, and it’s not being accepted by the server. I’ve tested this by manually sending requests to the server with both tokens, and only the browser token is accepted.
I’ve gone through the ClearML configuration file and didn't find any settings that could be causing this issue. Perhaps it is because I am using the wrong endpoint, since I am doing this:
local res, err = httpc:request_uri(" http://<my_host_ip>:8008/users.get_current_user ", {
method = "POST",
headers = {
["Authorization"] = "Bearer " .. token
}
})
if not res or res.status ~= 200 then
ngx.exit(ngx.HTTP_UNAUTHORIZED)
return
end