0

I have a gerrit setup on my server with http as a authentication method and nginx as server. I've created a admin account which works perfectly fine. I was trying to set up a another account with command

ssh -p 29418 admin@host gerrit create-account --group "'someGroup'" --email user@example.com --http-password "'somePassword'" user

and everything looked fine but now I'm not able to log into this account. I can find in nginx error log of gerrit site this error:

user "user" was not found in "/etc/nginx/.htpasswd"

Should I put this password of new user somewhere?

kebie
  • 141
  • 1
  • 1
  • 6

1 Answers1

0

This command creates a Gerrit account but it has nothing to do with authentication on Nginx side, I mean Nginx does not know of accounts in Gerrit so it won't let you pass through basic auth.

HTTP authentication in Gerrit means that www-server handles the authentication, Gerrit simply checks Authorization header.

You should add an entry for the new user to /etc/nginx/.htpasswd to make it work.

  • I see, but in that case what is the purpose of this http-password parameter? – kebie Nov 11 '17 at 22:50
  • Honestly I don't know. I couldn't find any use case for `--http-password`, probably you may use it with some external auth provider or with some gerrit plugin. – Paweł Tatarczuk Nov 12 '17 at 10:09
  • Documentation says `http-password` may be used to authenticate Git over HTTP and REST API: https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#auth.gitBasicAuthPolicy – Paweł Tatarczuk Nov 12 '17 at 10:25