ubuntu-hangups
ubuntu-hangups copied to clipboard
Account support for Ubuntu-hangups
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
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.
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/
@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?
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 thanks, that's a good idea, I'll try that. This wouldn't be possible without your great lib :)
@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 :)
From the log it looks like hangups isn't sending any cookies. Check that _get_session_cookies
isn't returning an empty dict.
@tdryer thanks and you're right, it returns an empty dict. What does this mean? Can I do anything to solve this?
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.
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/