I've been debugging the issue here, according to the steps (and the logs) which Renato provided me with.
So, a problem arises if the access token has expires and the refresh token (which can be used to request a new access token without UI interactions) is still valid, but the client application has been revoked access from https://myaccount.google.com/ (section "Connected apps and services"). In that case, here's the logs:
Feb 13 15:02:15 ubuntu-phablet signonpluginprocess[13128]: oauth2plugin.cpp 111 OAuth2Plugin :
Feb 13 15:02:15 ubuntu-phablet signonpluginprocess[13128]: oauth2plugin.cpp 206 respondWithStoredToken : Stored token is expired
Feb 13 15:02:15 ubuntu-phablet signonpluginprocess[13128]: oauth2plugin.cpp 586 refreshOAuth2Token : "1/XXXX"
Feb 13 15:02:15 ubuntu-phablet signonpluginprocess[13128]: oauth2plugin.cpp 598 sendOAuth2PostRequest :
Feb 13 15:02:15 ubuntu-phablet signonpluginprocess[13128]: oauth2plugin.cpp 623 sendOAuth2PostRequest : Query string = QUrl( "?grant_type=refresh_token&refresh_token=1/XXXX&client_id=759250720802-4sii0me9963n9fdqdmi7cepn6ub8luoh.apps.googleusercontent.com&client_secret=juFngKUcuhB7IRQqHtSLavqJ" )
Feb 13 15:02:15 ubuntu-phablet signonpluginprocess[13128]: base-plugin.cpp 112 postRequest : Posting request: QUrl( "https://accounts.google.com/o/oauth2/token" )
Feb 13 15:02:15 ubuntu-phablet signonpluginprocess[13128]: ../../../../src/remotepluginprocess/remotepluginprocess.cpp 496 startTask operation is completed
Feb 13 15:02:16 ubuntu-phablet signonpluginprocess[13128]: base-plugin.cpp 152 handleNetworkError : error signal received: 302
Feb 13 15:02:16 ubuntu-phablet signonpluginprocess[13128]: base-plugin.cpp 167 handleNetworkError : Contents: "{#012 "error" : "invalid_grant",#012 "error_description" : "Token has been revoked."#012}"
So, this is a but in signon-plugin-oauth2, which should discard the refresh token and try the authentication again if some error happens while using the refresh token.
I've been debugging the issue here, according to the steps (and the logs) which Renato provided me with.
So, a problem arises if the access token has expires and the refresh token (which can be used to request a new access token without UI interactions) is still valid, but the client application has been revoked access from https:/ /myaccount. google. com/ (section "Connected apps and services"). In that case, here's the logs:
Feb 13 15:02:15 ubuntu-phablet signonpluginpro cess[13128] : oauth2plugin.cpp 111 OAuth2Plugin : cess[13128] : oauth2plugin.cpp 206 respondWithStor edToken : Stored token is expired cess[13128] : oauth2plugin.cpp 586 refreshOAuth2Token : "1/XXXX" cess[13128] : oauth2plugin.cpp 598 sendOAuth2PostR equest : cess[13128] : oauth2plugin.cpp 623 sendOAuth2PostR equest : Query string = QUrl( "?grant_ type=refresh_ token&refresh_ token=1/ XXXX&client_ id=759250720802 -4sii0me9963n9f dqdmi7cepn6ub8l uoh.apps. googleuserconte nt.com& client_ secret= juFngKUcuhB7IRQ qHtSLavqJ" ) cess[13128] : base-plugin.cpp 112 postRequest : Posting request: QUrl( "https:/ /accounts. google. com/o/oauth2/ token" ) cess[13128] : ../../. ./../src/ remotepluginpro cess/remoteplug inprocess. cpp 496 startTask operation is completed cess[13128] : base-plugin.cpp 152 handleNetworkError : error signal received: 302 cess[13128] : base-plugin.cpp 167 handleNetworkError : Contents: "{#012 "error" : "invalid_ grant", #012 "error_description" : "Token has been revoked."#012}"
Feb 13 15:02:15 ubuntu-phablet signonpluginpro
Feb 13 15:02:15 ubuntu-phablet signonpluginpro
Feb 13 15:02:15 ubuntu-phablet signonpluginpro
Feb 13 15:02:15 ubuntu-phablet signonpluginpro
Feb 13 15:02:15 ubuntu-phablet signonpluginpro
Feb 13 15:02:15 ubuntu-phablet signonpluginpro
Feb 13 15:02:16 ubuntu-phablet signonpluginpro
Feb 13 15:02:16 ubuntu-phablet signonpluginpro
So, this is a but in signon- plugin- oauth2, which should discard the refresh token and try the authentication again if some error happens while using the refresh token.