Handle expired OAuth tokens
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 CredentialsExpi
2. When Handler sees this error, rather than reporting it to the client, ask online-accounts to authenticate again with interactive=true and invalidateCache
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
- Michi Henning (community): Approve
- unity-api-1-bot: Approve (continuous-integration)
-
Diff: 658 lines (+292/-48)17 files modifieddebian/changelog (+3/-0)
include/unity/storage/provider/Exceptions.h (+30/-0)
include/unity/storage/provider/internal/AccountData.h (+3/-3)
include/unity/storage/provider/internal/Handler.h (+5/-1)
include/unity/storage/qt/StorageError.h (+3/-2)
src/provider/Exceptions.cpp (+7/-0)
src/provider/internal/AccountData.cpp (+34/-9)
src/provider/internal/Handler.cpp (+54/-2)
src/provider/internal/ProviderInterface.cpp (+1/-12)
src/provider/internal/ServerImpl.cpp (+1/-0)
src/provider/internal/TestServerImpl.cpp (+1/-0)
src/qt/internal/StorageErrorImpl.cpp (+2/-1)
src/qt/internal/unmarshal_error.cpp (+1/-0)
tests/provider-ProviderInterface/ProviderInterface_test.cpp (+103/-0)
tests/utils/ProviderFixture.cpp (+3/-2)
tests/utils/ProviderFixture.h (+2/-1)
tests/utils/fake-online-accounts-daemon.py (+39/-15)
Changed in storage-framework (Ubuntu): | |
assignee: | nobody → James Henstridge (jamesh) |
status: | New → In Progress |
Changed in storage-framework (Ubuntu): | |
status: | In Progress → Fix Committed |
This bug was fixed in the package storage-framework - 0.3+17. 04.20170320. 1-0ubuntu1
--------------- 04.20170320. 1-0ubuntu1) zesty; urgency=medium
storage-framework (0.3+17.
[ James Henstridge ] eption to the provider library, so the provider
* Make providers exit after 30 seconds of inactivity. (LP: #1616758)
* Add UnauthorizedExc
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 ] storage: :provider: :Item to its own header file. (LP:
* Add a storage provider backed by the local file system.
* Move unity::
#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