mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Skip forceRefresh for full (owning) tenant (#22421)
This commit is contained in:
@@ -349,13 +349,14 @@ export abstract class AzureAuth implements vscode.Disposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// construct request
|
// construct request
|
||||||
// forceRefresh needs to be set true here in order to fetch the correct token, due to this issue
|
// forceRefresh needs to be set true here in order to fetch the correct token for non-full tenants, due to this issue
|
||||||
// https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/3687
|
// https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/3687
|
||||||
const tokenRequest = {
|
const tokenRequest = {
|
||||||
account: account,
|
account: account,
|
||||||
authority: `${this.loginEndpointUrl}${tenantId}`,
|
authority: `${this.loginEndpointUrl}${tenantId}`,
|
||||||
scopes: newScope,
|
scopes: newScope,
|
||||||
forceRefresh: true
|
// Force Refresh when tenant is NOT full tenant or organizational id that this account belongs to.
|
||||||
|
forceRefresh: tenantId !== account.tenantId
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
return await this.clientApplication.acquireTokenSilent(tokenRequest);
|
return await this.clientApplication.acquireTokenSilent(tokenRequest);
|
||||||
|
|||||||
Reference in New Issue
Block a user