-
Notifications
You must be signed in to change notification settings - Fork 1k
[23.1] Renew access tokens from PSA using valid refresh tokens #20040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release_23.1
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,7 +179,11 @@ def refresh(self, trans, user_authnz_token): | |
else: | ||
log.debug("No `expires` or `expires_in` key found in token extra data, cannot refresh") | ||
return False | ||
if int(user_authnz_token.extra_data["auth_time"]) + int(expires) / 2 <= int(time.time()): | ||
if ( | ||
int(user_authnz_token.extra_data["auth_time"]) + int(expires) / 2 | ||
<= int(time.time()) | ||
< int(user_authnz_token.extra_data["auth_time"]) + int(expires) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tokens I am getting have e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's confusing. In the database (table {
"access_token": "************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************",
"auth_time": 1738768462,
"expires_in": 3600,
"id_token": "**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************",
"refresh_token": "*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************",
"token_type": "Bearer"
} Don't the tokens you are referring to come from table There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kysrpex ugh, that is a disastrous split on how to handle this. :/ Maybe just my tokens (which are indeed from |
||
): | ||
on_the_fly_config(trans.sa_session) | ||
if self.config["provider"] == "azure": | ||
self.refresh_azure(user_authnz_token) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the
expires
is "seconds to expire from issue time" then this comparison is broken I think