-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Maybe somebody here can help me with the following problem: Using LibreOffice (which internally uses libcmis) to log into Google Drive (in LibreOffice, "File - Open Remote... - Add service - Type: Google Drive", enter "User" and "Password" and click "OK"), with two different @googlemail.com accounts, it consistently succeeds for one of them while it consistently fails with the other. (This is with #20 "Properly encode OAuth2 credentials" included, so it is unlikely that this is due to differences like e.g. the exact password spelling.)
Debugging into OAuth2Providers::OAuth2Gdrive in src/libcmis/oauth2-providers.cxx (with passing verbose = true into SessionFactory::createSession in src/libcmis/session-factory.cxx, plus some printf), the two cases proceed the same up until sending loginPasswdPost as POST request (in // STEP 3: password page). In both cases, loginPasswdPost looks like (broken up for better readability)
Page=PasswordSeparationSignIn
&GALX=XXXXXXXXXXX
&gxf=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXQ%3AXXXXXXXXXXXXX
&continue=https%3A%2F%2Faccounts.google.com%2Fo%2Foauth2%2Fauth%3Fscope%3Dhttps%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive%26redirect_uri%3Durn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob%26response_type%3Dcode%26client_id%3D280867422816-9jc83t6phkfb2q8p94dtk8kr5fa8af3r.apps.googleusercontent.com%26from_login%3D1%26as%3DXXXXXXXXXXXXXXXXXXXXXX
&followup=https%3A%2F%2Faccounts.google.com%2Fo%2Foauth2%2Fauth%3Fscope%3Dhttps%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive%26redirect_uri%3Durn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob%26response_type%3Dcode%26client_id%3D280867422816-9jc83t6phkfb2q8p94dtk8kr5fa8af3r.apps.googleusercontent.com%26from_login%3D1%26as%3DXXXXXXXXXXXXXXXXXXXXXX
<mpl=nosignup
&scc=1
&sarp=1
&oauth=1
&flowName=GlifWebSignIn
&ProfileInformation=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
&SessionState=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
&_utf8=%E2%98%83
&bgresponse=js_disabled
&Email=XXXXXXXXXXXXXXXXXXXXXXXXXX%40googlemail.com
&signIn=Anmelden
&PersistentCookie=yes
&Passwd=XXXXXXXXXX
However, the responses from the server differ. In the successful case, we get a 302 Moved Temporarily response with Location: https://accounts.google.de/accounts/SetSID?ssdc=..., ultimately GETing a /o/oauth2/auth?scope=https://www.googleapis.com/auth/drive&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&client_id=... HTML page titled "Request for Permission" and which is apparently as expected by the next call into parseResponse, causing OAuth2Providers::OAuth2Gdrive to return successfully with some non-empty code.
But in the failing case, we directly get a 200 OK HTML page titled "Anmelden – Google Konten" (stuff is apparently localized on the server end, I'm doing this from Germany) which is apparently not as expected by the next call into parseResponse, and which causes OAuth2Providers::OAuth2Gdrive to fail returning an empty code.
(And when deliberately trying with a bad user name, or with the otherwise successful user name and a wrong password, behavior is different still, ruling out the assumption that the failing case's user name or password is bad: For a bad user name, the HTML page retrieved in // STEP 2: send email already is different, containing some has-error stuff. And for a bad password, the HTML page retrieved in // STEP 3: password page contains such has-error stuff.)
This may not even be an issue with libcmis. It smells like something is set up differently for those two Google accounts, but I have no idea what that could be. (And I get reports from other people too that their accounts don't work, in the same way.) Does anybody have an idea what might go wrong?