cosmocode / dokuwiki-plugin-oauth

Generic oAuth1 and oAuth2 plugin for DokuWiki
http://www.dokuwiki.org/plugin:oauth
30 stars 79 forks source link

Token refreshment (feature request) #100

Closed rellampec closed 3 years ago

rellampec commented 3 years ago

The authentication token for Google OAuth2 expires very soon. This is an issue because a user might be in the middle of an edit, and when clicking on SAVE will be prompted with the authentication screen (leading some times to lose all the changes of the last edit).

For security reasons, there is no way from the Cloud Application to change the expiry time on the OAuth 2.0 Client IDs under Credentials. However, it is possible from the client-side to refresh the token.

$client->setAccessType("offline");

Access tokens periodically expire and become invalid credentials for a related API request. You can refresh an access token without prompting the user for permission (including when the user is not present) if you requested offline access to the scopes associated with the token.

Not quite sure if that is all that is needed, but:

rellampec commented 3 years ago

mmmh... just saw that you can actually set the auth_security_timeout to a greater value... that must do it!