fix: Azure single-tenant SSO tokens are unable to refresh (#5551)

This commit is contained in:
Tom Moor
2023-07-11 18:59:28 -04:00
committed by GitHub
parent 5ae4834333
commit c56add74c6
3 changed files with 42 additions and 6 deletions

View File

@@ -93,6 +93,7 @@ class UserAuthentication extends IdModel {
): Promise<boolean> {
// Check a maximum of once every 5 minutes
if (this.lastValidatedAt > subMinutes(Date.now(), 5) && !force) {
Logger.debug("utils", "Skipping access token validation");
return true;
}
@@ -158,7 +159,10 @@ class UserAuthentication extends IdModel {
const client = authenticationProvider.oauthClient;
if (client) {
const response = await client.rotateToken(this.refreshToken);
const response = await client.rotateToken(
this.accessToken,
this.refreshToken
);
// Not all OAuth providers return a new refreshToken so we need to guard
// against setting to an empty value.