Handle expired OAuth tokens

Bug #1616756 reported by James Henstridge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
storage-framework (Ubuntu)
Fix Released
Undecided
James Henstridge

Bug Description

For most online services, you can only determine that your credentials have expired by attempting to make an API call. So we need some way for the provider specific code to inform us that this has happened and react appropriately.

This should look something like:

1. provider code signals problem via a CredentialsExpiredError exception

2. When Handler sees this error, rather than reporting it to the client, ask online-accounts to authenticate again with interactive=true and invalidateCachedReply=true.

3. If the authenticate() call returns an error, send an error to the client. If it succeeds, call the handler callback a second time with the new credentials.

4. If the provider code throws CredentialsExpired a second time, report an error to the user.

Related branches

Changed in storage-framework (Ubuntu):
assignee: nobody → James Henstridge (jamesh)
status: New → In Progress
Changed in storage-framework (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package storage-framework - 0.3+17.04.20170320.1-0ubuntu1

---------------
storage-framework (0.3+17.04.20170320.1-0ubuntu1) zesty; urgency=medium

  [ James Henstridge ]
  * Make providers exit after 30 seconds of inactivity. (LP: #1616758)
  * Add UnauthorizedException to the provider library, so the provider
    can trigger reauthentication of the account and have the request
    restarted. (LP: #1616756)
  * Dynamically add and remove providers as the associated accounts
    are enabled and disabled. (LP: #1616757)
  * Allow creation of storage providers that don't use online-accounts.
    Thisis likely only of interest to the local storage provider.

  [ Michi Henning ]
  * Add a storage provider backed by the local file system.
  * Move unity::storage::provider::Item to its own header file. (LP:
    #1668872)
  * If a provider can't acquire its D-Bus well known name, exit rather
    than throwing a (usually uncaught) exception. (LP: #1604640)

 -- Michi Henning <email address hidden> Mon, 20 Mar 2017 04:51:08 +0000

Changed in storage-framework (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.