Bug 501672 - Not able to login to Gerrit upstream from EGerrit
Summary: Not able to login to Gerrit upstream from EGerrit
Status: UNCONFIRMED
Alias: None
Product: Egerrit
Classification: Technology
Component: Core (show other bugs)
Version: 1.1.0   Edit
Hardware: PC Linux
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-19 04:01 EDT by David Ostrovsky CLA
Modified: 2016-09-20 20:20 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Ostrovsky CLA 2016-09-19 04:01:23 EDT
Trying to use my Google user an password, I'm refused to get connected:

URL: https://gerrit-review.googlesource.com

The error message is: " Server [ https://gerrit-review.googlesource.com ] ha an invalid User and/or Password".

Version: 1.1.0.657.
Comment 1 Matthias Sohn CLA 2016-09-20 18:31:08 EDT
I traced logon to https://gerrit-review.googlesource.com using mitmproxy:

EGerrit tries to logon by sending a POST request to
https://gerrit-review.googlesource.com/login/mine
with ContentType: application/x-www-form-urlencoded
passing username and password in the body

The server responds with an HTML page with embedded javascript redirect which EGerrit seems not to understand

<!DOCTYPE html>
<html>
  <head>
    <title>Redirecting...</title>
    <script type="text/javascript" language="javascript">var url = 'https:\/\/www.google.com\/accounts\/ServiceLogin?service\x3dgerritcodereview\x26pass
ive\x3d1209600\x26continue\x3dhttps:\/\/gerrit-review.googlesource.com\/login\/mine%23__HASH__\x26followup\x3dhttps:\/\/gerrit-review.googlesource.com\/
login\/mine'; var fragment = ''; if (self.document.location.hash) {fragment = self.document.location.hash.replace(/^#/,'');}url = url.replace(new
RegExp("__HASH__", 'g'), encodeURIComponent(fragment));window.location.assign(url);</script>
    <noscript>
      <meta http-equiv="refresh" content="0; url='https://www.google.com/accounts/ServiceLogin?service=gerritcodereview&amp;passive=1209600&amp;continue
=https://gerrit-review.googlesource.com/login/mine&amp;followup=https://gerrit-review.googlesource.com/login/mine'"/>
    </noscript>
  </head>
  <body/>
</html>

following [1] you could try to prefix the endpoint URL with a/ in order to trigger authentication

[1] https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication
Comment 2 Pascal Rapicault CLA 2016-09-20 20:20:20 EDT
Could it be that upstream gerrit only works with OAuth?