401 Unauthorized when contacting API from a JVM

Hello, I wonder if someone experienced my same problem.

I have grafana running on a CentOS 7 in a VM (kvm), and when I use CURL from the command line (Ubuntu 18) everything works fine.

I have to write a daemon and here “the language of choiche” run on a JVM. I tried both Apache HTTP client and a library called curly found on GitHUB.

With both libraries I get a 401 and {“message”:“unauthorized”} as a reply when I try to lookup the id of a user using basic authentication.

In the grafana log I find

t=2019-01-16T11:10:07-0500 lvl=info msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=GET path=/api/users/lookup status=401 remote_addr= time_ms=1 size=26 referer=

as if it did not receive the user and password data have not reached the server, but the JVM stack trace shows a complete http://user:password@ip.ad.dr.es/api/users/lookup?loginOrEmail=admin.

Any idea?

I am really considering throwing the JVM in the sink…