Comment 5 for bug 1248326

Revision history for this message
Alberto Mardegan (mardy) wrote : Re: [Bug 1248326] Re: Handle invalidated token in a more user-friendly way

On 11/20/2013 12:30 AM, Mike McCracken wrote:
> @Alberto, ubuntuone-credentials uses signon-plugin-password. We don't use a custom signon plugin.
> This was the fastest path to code we could be confident in - it reuses most of the previously working code that used the keyring.

Right, I forgot about it.

> Remember, we have custom QML UI for the login screen, which means we have these options:
> 1. a U1 signon plugin has to display that UI (no plugin exists, and AFAIK, it is not currently supported for plugins to show QML UI on Touch)
> 2. we add support to libubuntuoneauth for the client app to show the login UI (possible, but not trivial, and breaks the 'everything in online-accounts' goal)
> 3. in the client, we simply delete the current U1 account via existing tested API in libubuntuoneauth, and show the user a message to go recreate it. This is the fastest way to a better experience - it's a small change, it's well tested and it's only a bit more annoying.
> It also doesn't lose any per-app access settings (which would be one reason to avoid just nuking an existing account), because u1 doesn't use any.

I agree with you that option #2 is bad. #3 is obviously a workaround, so
I'm all for option #1.
It's actually easier than what you think: signond already supports a
special parameter to clear the stored password ("UiPolicy": 1 -- it's an
enum, defined in <SignOn/SessionData> aka
/usr/include/signon-qt5/SignOn/session-data.h). With this flag, the
signon-plugin-password will receive an empty password, and will ask
signond to fire up signon-ui to request a new password from the user.

This can work already now on the desktop, however I didn't try it on the
phone; given that for this code-path signon-ui is using a QWidget-based
UI, things might not work.
However, it shouldn't be too hard to implement the same UI in QML, and
it's something that needs to be done anyway, sooner or later.

So, please try this out and let me know. If things don't work, I can
prioritize this work in signon-ui.