ubuntu-hangups icon indicating copy to clipboard operation
ubuntu-hangups copied to clipboard

Account support for Ubuntu-hangups

Open bartoszkosiorek opened this issue 9 years ago • 10 comments

It will be great to add support for Accounts. With that users could provide google login and password only once.

To do that, you could take a look at Google+ application from Szymon Waliczek: https://code.launchpad.net/~majster-pl/+junk/gPlus https://code.launchpad.net/~majster-pl/+junk/google-plus-webapp

bartoszkosiorek avatar Sep 02 '15 12:09 bartoszkosiorek

Not sure whether the webapp helps as an example. I think the relevant code there is:

Exec=webapp-container --store-session-cookies  --accountProvider='google' ...

(Source: google-plus-app.desktop, line 6)

Just guessing, though.

bittner avatar Sep 02 '15 12:09 bittner

Since Ubuntu-Hangups is a native app, it is best to use the Ubuntu Online-Account QML API that you can find at [1] and [2]. This will then make it possible for Ubuntu-Hangups to automatically get the user's google account credentials without having the user to enter it in manually. Also at any point, the user can enable/disable google account access and improve integration with the platform.

[1] https://developer.ubuntu.com/api/apps/qml/sdk-15.04/Ubuntu.OnlineAccounts/ [2] https://developer.ubuntu.com/en/start/platform/guides/online-accounts-developer-guide/

krnekhelesh avatar Sep 02 '15 12:09 krnekhelesh

@gang65 @bittner @krnekhelesh Thanks for the suggestions, but I fear that's not possible, sorry. As far as I know Hangups is logging itself in as an iOS-Device. I'm not completely sure, but I think that if it was authenticating via Online Accounts it wouldn't have access to Hangouts. @tdryer is this correct, or am I wrong?

timsueberkrueb avatar Sep 02 '15 18:09 timsueberkrueb

hangups uses OAuth to log in, but it has to pretend to be an iOS device in order to get access to the private Hangouts APIs. You might be able to use Online Accounts to display the OAuth prompt in a web view where the user is already logged into Google.

Nice project by the way, I wasn't aware of it. :smile:

tdryer avatar Sep 02 '15 18:09 tdryer

@tdryer thanks, that's a good idea, I'll try that. This wouldn't be possible without your great lib :)

timsueberkrueb avatar Sep 02 '15 18:09 timsueberkrueb

@tdryer When you have time, could you take a quick look at this: https://plus.google.com/+TimS%C3%BCberkr%C3%BCbDE/posts/Gx12EaXJ5Fc? The problem is that it's impossible to log the user just in a webview via Online Accounts it does an OAuth authentication. I set the Hangups client id and secret but it fails nevertheless. Do you know where the problem could lie? Is it possible to do that this way at all? Thanks :)

timsueberkrueb avatar Sep 08 '15 20:09 timsueberkrueb

From the log it looks like hangups isn't sending any cookies. Check that _get_session_cookies isn't returning an empty dict.

tdryer avatar Sep 09 '15 02:09 tdryer

@tdryer thanks and you're right, it returns an empty dict. What does this mean? Can I do anything to solve this?

timsueberkrueb avatar Sep 09 '15 08:09 timsueberkrueb

Maybe the access token is invalid. You could try comparing the responses to the requests that _get_session_cookies makes with a normal hangups login to see if there's an error.

tdryer avatar Sep 10 '15 01:09 tdryer

Here is some interesting information about online-account: http://summit.ubuntu.com/uos-1511/meeting/22604/taking-advantage-of-ubuntu-online-accounts-in-your-application/

bartoszkosiorek avatar Nov 05 '15 23:11 bartoszkosiorek