MSAL Redirect Funkiness (#264057)

Why do they do this to me...
This commit is contained in:
Tyler James Leonhardt
2025-08-29 11:47:16 -07:00
committed by GitHub
parent 4c635ca9f9
commit 70e7eae770

View File

@@ -484,11 +484,18 @@ export class MsalAuthProvider implements AuthenticationProvider {
forceRefresh = true;
claims = scopeData.claims;
}
let redirectUri: string | undefined;
// If we have the broker available and are on macOS, we HAVE to include the redirect URI or MSAL will throw an error.
// HOWEVER, if we are _not_ using the broker, we MUST NOT include the redirect URI or MSAL will throw an error.
if (cachedPca.isBrokerAvailable && process.platform === 'darwin') {
redirectUri = Config.macOSBrokerRedirectUri;
}
const result = await cachedPca.acquireTokenSilent({
account,
authority,
scopes: scopeData.scopesToSend,
claims,
redirectUri,
forceRefresh
});
sessions.push(this.sessionFromAuthenticationResult(result, scopeData.originalScopes));