Skip to content

Commit d12854f

Browse files
Default MSAL to true (microsoft#234290)
Using new `microsoft-authentication.implementation` setting
1 parent 2e93ebc commit d12854f

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

extensions/microsoft-authentication/package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,18 @@
100100
{
101101
"title": "Microsoft",
102102
"properties": {
103-
"microsoft.useMsal": {
104-
"type": "boolean",
105-
"description": "%useMsal.description%",
103+
"microsoft-authentication.implementation": {
104+
"type": "string",
105+
"default": "msal",
106+
"enum": [
107+
"msal",
108+
"classic"
109+
],
110+
"enumDescriptions": [
111+
"%microsoft-authentication.implementation.enumDescriptions.msal%",
112+
"%microsoft-authentication.implementation.enumDescriptions.classic%"
113+
],
114+
"description": "%microsoft-authentication.implementation.description%",
106115
"tags": [
107116
"onExP",
108117
"preview"

extensions/microsoft-authentication/package.nls.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"description": "Microsoft authentication provider",
44
"signIn": "Sign In",
55
"signOut": "Sign Out",
6-
"useMsal.description": "Use the Microsoft Authentication Library (MSAL) to sign in with a Microsoft account.",
6+
"microsoft-authentication.implementation.description": "The authentication implementation to use for signing in with a Microsoft account.",
7+
"microsoft-authentication.implementation.enumDescriptions.msal": "Use the Microsoft Authentication Library (MSAL) to sign in with a Microsoft account.",
8+
"microsoft-authentication.implementation.enumDescriptions.classic": "Use the classic authentication flow to sign in with a Microsoft account.",
79
"microsoft-sovereign-cloud.environment.description": {
810
"message": "The Sovereign Cloud to use for authentication. If you select `custom`, you must also set the `#microsoft-sovereign-cloud.customEnvironment#` setting.",
911
"comment": [

extensions/microsoft-authentication/src/extension.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ import Logger from './logger';
1313

1414
function shouldUseMsal(expService: IExperimentationService): boolean {
1515
// First check if there is a setting value to allow user to override the default
16-
const inspect = workspace.getConfiguration('microsoft').inspect<boolean>('useMsal');
16+
const inspect = workspace.getConfiguration('microsoft-authentication').inspect<'msal' | 'classic'>('implementation');
1717
if (inspect?.workspaceFolderValue !== undefined) {
1818
Logger.debug(`Acquired MSAL enablement value from 'workspaceFolderValue'. Value: ${inspect.workspaceFolderValue}`);
19-
return inspect.workspaceFolderValue;
19+
return inspect.workspaceFolderValue === 'msal';
2020
}
2121
if (inspect?.workspaceValue !== undefined) {
2222
Logger.debug(`Acquired MSAL enablement value from 'workspaceValue'. Value: ${inspect.workspaceValue}`);
23-
return inspect.workspaceValue;
23+
return inspect.workspaceValue === 'msal';
2424
}
2525
if (inspect?.globalValue !== undefined) {
2626
Logger.debug(`Acquired MSAL enablement value from 'globalValue'. Value: ${inspect.globalValue}`);
27-
return inspect.globalValue;
27+
return inspect.globalValue === 'msal';
2828
}
2929

3030
// Then check if the experiment value
@@ -36,7 +36,7 @@ function shouldUseMsal(expService: IExperimentationService): boolean {
3636

3737
Logger.debug('Acquired MSAL enablement value from default. Value: false');
3838
// If no setting or experiment value is found, default to false
39-
return false;
39+
return true;
4040
}
4141
let useMsal: boolean | undefined;
4242

@@ -50,7 +50,7 @@ export async function activate(context: ExtensionContext) {
5050
useMsal = shouldUseMsal(expService);
5151

5252
context.subscriptions.push(workspace.onDidChangeConfiguration(async e => {
53-
if (!e.affectsConfiguration('microsoft.useMsal') || useMsal === shouldUseMsal(expService)) {
53+
if (!e.affectsConfiguration('microsoft-authentication.implementation') || useMsal === shouldUseMsal(expService)) {
5454
return;
5555
}
5656

0 commit comments

Comments
 (0)