squalou / google-chat-linux

source of a fork of google-chat-linux unofficial client from robyf
51 stars 10 forks source link

Empty screen on OAuth w/ Atlassian Crowd #23

Closed janitza-thbe closed 3 years ago

janitza-thbe commented 3 years ago

After providing the e-mail address in Google's login frame I usually become redirect to my companies Atlassian Crowd authentication page (OAuth).

In the title bar the correct text "Atlassian Crowd - Login" appears but the window screen stays completely blank so that a further use is not possible. Even restarts lead to the same reproducible result.

Maybe a cookie/safety problem?

I've installed the provided Debian package v0.5.6-1 under Ubuntu 20.10 aka Groovy.

Thanks so far.

squalou commented 3 years ago

Hi,

sorry to hear that. My first bet would be that it's due to the redirection handling that is done with url, in order to

It was only ever tested with google as auth provider.

In your case if I understand well : looks like you stay inside electron client window ... but auth page doesn't work / doesn't even display.

Could you try to display the "Developer Menu" (Push Alt button to reveal top menu, then developer tools) show console, try to login and see what is displayed ?

Honestly, not being able to reproduce it myself will not make it an easy task to solve this. But I'll try.

If you ever want to try something yourself, things do happen here https://github.com/squalou/google-chat-linux/blob/master/src/window.js around line 141. You could complete the 'else' condition, or remove it entirely and see what happens.

    } else if (! url.includes("accounts/SetOSID?authuser=0&continue=https%3A%2F%2Fchat.google.com") && ! url.includes("accounts.google.com/signin")){
        shell.openExternal(url);
        e.preventDefault();
    }

Let me know if you see / find anything.

In the meantime, if you're looking for a working client, you can also try ferdi : it works fine (disable enhanced dark mode to keep good performances though) https://getferdi.com/download

janitza-thbe commented 3 years ago

Sorry for my late reply. Seems that I didn't recognize the notification of your response.

Indeed I'm not a Web Dev Pro but more embedded experienced.

But I see a good way to reproduce it even by yourself: Just enter any e-mail address of type [anything] { at } janitza { dot } de and you will be redirected to the reported Crowd Login page

Thanks for the hint w/ Ferdi, but it's hangouts based and I can't access my Google Chat Rooms and Group Chats w/ it. So I'm in hope that we could find a solution w/ Google Chat Linux.

If you need additional information or even a re-test, I can help you.

squalou commented 3 years ago

Will give it a try asap.

About Ferdi I'm surprised : I've been using it with several services : both Hangouts and Chat are supported. (blame Google on naming confusion here)

I even added the custom.css found in this repo, it works :)

squalou commented 3 years ago

does not work : with a non existing email, the connexion windows stays at the first step with a red message "Sorry adress unkown"

(freely translated, I see it in french in my case : Désolé, nous ne reconnaissons pas cette adresse e-mail.)

I could try with a real email (without password of course, and not posted here :) ) See if direct mail from github works maybe ?

janitza-thbe commented 3 years ago

Unfortunalety I don't receive any notifications any more. :( I sent you an mail to your Git's email address w/ the information.

squalou commented 3 years ago

Thank you for the additional info, with this I managed to guess what's happening. The cause is a security matter, Crowd page refuses to launch in eletron when 'node integration' is enabled.

To make it short :

It would be a good news if it does BUT don't be happy too fast : Disabling the so called "node integration" breaks some features. Namely : the icon color change in systray (grey/blue/green/red depending on messages)

This is a nice feature, probably the only reason I maintain this for myself :)

So : in case it works, you should try to go in the same menu, and enable Node integration again, and see if it continues to work. and maybe it may contnue to work, until next login is required.

That's a lots of maybe .... let me know if anything gets better or if you're sadly still stuck right after the login form.

:crossed_fingers:

image

janitza-thbe commented 3 years ago

You're right. If I follow your described step, the Crowd login page becomes displayed correctly! :+1:

Unfortunalety the login redirection from Crowd to Google Chat still does'nt work: The login is accepted but instead of opening the redirection link in electron a system editor (in my case Kate) is launched to open the URL (and display the file contents).

Let me say another time a big thanks for your support so far!

squalou commented 3 years ago

This one may be easier to fix. There's a little trick to open urls either inside the client, or to open it externally using your system default.

So far I check for url "starting with" something, to only keep login pages inside the client.

In your case, I believe there's a redirection to https://chat.google.com/

Can you check it's this url that is sent to kate somehow ? Or at least that it starts with that ?

If you can't, I'll give it a quick try with this blindly (or maybe add yet another option to keep urls inside client, why not after all)

EDIT :

give a try to 0.5.7-2 I added options in the Menu again, to keep all URLS inside, it's easier to try than to discuss things :)

https://github.com/squalou/google-chat-linux/releases/tag/0.5.7-2

janitza-thbe commented 3 years ago

Hi squalou,

finally I got login to work w/ help of disabling Node integration and using your new option to Open URLs inside Electron. After all redirections the Google Chat interface displayed up and I could reset previous settings to default --> keeps working w/ existing OAuth token. :+1:

Regarding to the redirect URL: After authentication crowd forwards to another company internal URL first. That's the link that displayed up in editor. I think w/ the embedded token this service redirects to Google OAuth backend, that redirects to its Chat finally. So this seems to keep a bit complicated.

Maybe it would be a solution to automatically turn off Node integration + switch to open URLs internally until Electron is redirected to the well-known Google Chat URL/domain again?

squalou commented 3 years ago

Good news ! Thanks for the feedback. You'll probably be bothered again something like once in a month, not so bad for a start.

Yes, something like "turn off during login" option, then switch back to normal when a redirect to chat.google.com is detected should work. I'll have to pay extra attention not to infinite loop over client restart :) (Node integration on/off requires a full restart sadly). Fully automating the "turn off if not logged in" may be the more difficult part.

Anyway, it leaves me some time to try something :-)

squalou commented 3 years ago

in the meantime I reordered things a bit. Nothing new, just a cleanup in menu.

There one menu entry that does it all for you (node integration + keep urls inside), I'll keep trying to automate things a bit.

https://github.com/squalou/google-chat-linux/releases/tag/0.5.7-3

squalou commented 3 years ago

Added menu entry to "systray menu", and closing this issue so far. (0.5.7-5) If I ever find a way to properly automate the "return to normal", I'll do it someday.

Thank you again by the way, with your help this little app has greatly improved :) see #25 : other people are already using this new feature.