This PR introduces the implementation of the refresh token flow for the OAuth2 protocol, enabling us to shorten token lifespans without breaking user experience.
Changes
the authenticate method now checks if it's possible to refresh tokens when an expired accesstoken is used, and if so it performs the refresh setting new cookies values to be added to the response in a request context ( g.auth_cookies) to be used in a custom afterresponse func (this was done to avoid handling response objects manually since a view function could return either a dict and a code like in app.py, or a true Response object, like in handlers.py)
Description
This PR introduces the implementation of the refresh token flow for the OAuth2 protocol, enabling us to shorten token lifespans without breaking user experience.
Changes
authenticate
method now checks if it's possible to refresh tokens when an expired accesstoken is used, and if so it performs the refresh setting new cookies values to be added to the response in a request context (g.auth_cookies
) to be used in a customafterresponse
func (this was done to avoid handling response objects manually since a view function could return either a dict and a code like inapp.py
, or a trueResponse
object, like inhandlers.py
)How Has This Been Tested?
References
PR Quality Checklist
i18n
solution instead (see here)npm run build
builds without any errorIn order to increase the likelihood of your contribution being accepted, please make sure you have read both the Contributing Guidelines and the Project Guidelines
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.