3 Changes to MSAL auth (#226580)

* Remove access token refreshing logic. The new calling pattern for an extension is that they should just always call `getSession` before doing something with it. The session that returns will be valid because MSAL will refresh any access tokens that are close to expiry using the refresh tokens that it has
  * NOTE: access tokens expire after 1hr. Refresh tokens expire after like... many days.
* Have `createSession` fire an `onDidChangeSession` event so that the badge goes away
* Improved logging messages
This commit is contained in:
Tyler James Leonhardt
2024-08-25 23:27:20 -07:00
committed by GitHub
parent 8a625dc1db
commit 214bf83a48
2 changed files with 22 additions and 57 deletions

View File

@@ -172,6 +172,7 @@ export class MsalAuthProvider implements AuthenticationProvider {
const session = this.toAuthenticationSession(result, scopeData.originalScopes);
this._telemetryReporter.sendLoginEvent(session.scopes);
this._logger.info('[createSession]', scopeData.scopeStr, 'returned session');
this._onDidChangeSessionsEmitter.fire({ added: [session], changed: [], removed: [] });
return session;
}