Re get Google credentials from KAccounts when a refresh is needed.
ClosedPublic

Authored by barchiesi on Jun 22 2019, 6:32 PM.

Details

Summary

Currently, when the Google access token in use expires, the KIO slave silently ignores refreshing the token (only 'not implemented' gets logged) and fails all subsequent api requests. This patch prevents the slave from breaking by requesting new credentials from KAccounts.

Test Plan

Open a Google Drive folder in Dolphin, wait until accounts token needs a refresh, open another Google Drive folder. The folder loads because a new access token was requested.

Diff Detail

Repository
R219 KIO GDrive
Branch
arcpatch-D22009
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 13663
Build 13681: arc lint + arc unit
barchiesi requested review of this revision.Jun 22 2019, 6:32 PM
barchiesi created this revision.

@elvisangelaccio We have a refresh token available that could be used but I couldn't find any information regarding refreshing an account through KAccounts. Do you know if such functionality is available? If not, would you perhaps know who I can reach out to?

@elvisangelaccio We have a refresh token available that could be used but I couldn't find any information regarding refreshing an account through KAccounts. Do you know if such functionality is available? If not, would you perhaps know who I can reach out to?

I don't know, sorry.

You can try to ask @mck182 (original KAccounts author), but you probably want to ask the signon developers first: https://accounts-sso.gitlab.io/

src/kaccountsmanager.cpp
88–100

const

src/kaccountsmanager.h
43

const QString&

barchiesi updated this revision to Diff 61251.Jul 6 2019, 11:27 AM

Fixed the const issues.

barchiesi updated this revision to Diff 61252.Jul 6 2019, 11:30 AM

Changed commit email address.

Looking at accounts-sso/signon-plugin-oauth2, it seems they switch to refreshing if a previous token request returned a refresh_token in the response (which should be our case).

elvisangelaccio accepted this revision.Jul 7 2019, 7:51 PM
This revision is now accepted and ready to land.Jul 7 2019, 7:51 PM
This revision was automatically updated to reflect the committed changes.