Gerrit 2.6.1 - REST - LDAP - Authentication Failure.

1,623 views
Skip to first unread message

Alan

unread,
Jul 3, 2013, 7:24:09 AM7/3/13
to repo-d...@googlegroups.com
Hi,

I recently upgraded our server to 2.6.1 to obtain the latest restful services.

Unfortunately I cannot seem to authenticate via any /a/ requests.

I've tried the firefox rest client and the intelliJ gerrit plugin and both fail with authentication failures.

The firefox client prompts for a username and password - but upon entering my ldap details (which works via the web ui) - it simply returns a 401.

I have tried the curl with digest option and once again it fails.

The error is:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 401 Unauthorized</title>
</head>
<body>
<h2>HTTP ERROR: 401</h2>
<p>Problem accessing /a/projects. Reason:
<pre>    Unauthorized</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>

So my question is - does it work with the LDAP authentication setting?

I see nothing in the logs (errors for example)

Cheers  


This email was sent by a company owned by Pearson plc, registered office at 80 Strand, London WC2R 0RL.  Registered in England and Wales with company number 53723.

Alan

unread,
Jul 3, 2013, 8:41:25 AM7/3/13
to repo-d...@googlegroups.com
Oh - if I log into the web ui and then perform a restful call via the same browser then of course it works.

Bassem Rabil

unread,
Jul 3, 2013, 10:25:17 AM7/3/13
to repo-d...@googlegroups.com
Hi Alan 

I tried this with 2.6rc4 and it used to work fine:

curl -u <username> http://<ip-address>:<port>/a/accounts/self/capabilities

I hope this helps.

Thanks
Bassem

Bassem Rabil

unread,
Jul 3, 2013, 10:26:12 AM7/3/13
to repo-d...@googlegroups.com
I forgot to mention that of course you get prompted for LDAP password.

Doug Kelly

unread,
Jul 3, 2013, 11:01:54 AM7/3/13
to repo-d...@googlegroups.com
See the discussion here:

Long story short, you need to use DIGEST auth, not BASIC.

Nicholas Caley

unread,
Oct 31, 2013, 11:23:55 AM10/31/13
to repo-d...@googlegroups.com
I ran into this same issue, but I'm still stuck.

I'm attempting a simple curl command to the gerrit API

curl --digest -u <user> http://<url:port>/a/accounts/self/capabilities


Enter host password for user '<user>':

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 401 Unauthorized</title>
</head>
<body>
<h2>HTTP ERROR: 401</h2>
<p>Problem accessing /a/accounts/self/capabilities. Reason:

<pre>    Unauthorized</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>

I can make the same REST call from my browser through a REST client application in Chrome and it works fine, but using curl does not seem to work. 

Any other ideas on what could be wrong?

Edwin Kempin

unread,
Oct 31, 2013, 11:33:28 AM10/31/13
to Nicholas Caley, Repo and Gerrit Discussion
Have you entered the HTTP passowrd of the user from
  http://<url:port>/#/settings/http-password
?


2013/10/31 Nicholas Caley <pot...@gmail.com>

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Nicholas Caley

unread,
Oct 31, 2013, 11:51:30 AM10/31/13
to repo-d...@googlegroups.com, Nicholas Caley
Thanks, that fixed it!
I was using my normal login info.
Reply all
Reply to author
Forward
0 new messages