When I use RestTemplate to send a login post request to grafana, there is a error "index out of range" in grafana backend

i have create user user1 before
my java code:


grafana bakend error:

can anyone help me? thank u !

Which version of Grafana are you using?

For programmatic access to Grafana the Authentication HTTP API wiki page outlines how to access Grafana. The login endpoint that you’re using isn’t part of the API and might be changed at any point.

yes, u r right,the login endpoint isn’t need to use BasicAuth , BasicAuth or ApiKey is used by grafana http api。
thank u!

Awesome! You’re welcome :slight_smile: