0

I want to look up some review comments on Gerrit via the REST API. I tried a few methods, including Gerrit's official documentation, and nothing changed the fact that I was an anonymous user. The authentication configuration in the gerrit.config is as follow:

[auth]
    type = LDAP
    gitBasicAuthPolicy = LDAP

I'm calling rest api by curl

$ curl --digest --user LDAP_user:LDAP_password \
      https://gerrit.example.com/a/path/to/api

It does not work.

henryCYZP
  • 9
  • 6

3 Answers3

1

Digest authentication was removed from Gerrit in release 2.14. Remove the "--digest" parameter and the "curl" command will work.

More info in Gerrit 2.14 release notes here.

0

HTTP_PASSWORD maybe the answer which can be found in account settings.

And then

curl -u USR_NAME:HTTP_PASSWORD https://gerrit.XX.com/a/path/to/api
Dharman
  • 30,962
  • 25
  • 85
  • 135
B.Kingsun
  • 350
  • 3
  • 11
0

What's your Gerrit version?
2.14 and newer require basic auth, as already mentioned by Marcelo (maybe you have to explicitly give --basic ).
2.13 and older use digest; you will also be interested in this post if you are using versions that old.

Roman
  • 707
  • 8
  • 16