-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Metaissue] Migrate to MSAL #178740
Comments
I attempted to implement this but ran into a major problem: MSAL-node doesn't support a shared cache across PCAs well. This would be required if you have multiple VS Code windows open... You sign out of an account in window A, and you expect window B to reflect that signed out account. I have opened 3 issues internally that are as followed: Deserializing in an ICachePlugin keeps around old stateIn the beforeCacheAccess we are told to basically:
In other words: async beforeCacheAccess(tokenCacheContext: TokenCacheContext): Promise<void> {
const data = await this._secretStorage.get();
if (data) {
tokenCacheContext.tokenCache.deserialize(data);
}
} My initial assumption was that the call to But I was wrong. Here's what runs: You'll notice that cache is created by combining the previous values of the cache with the new values of the cache. This is not the behavior I'm looking for. I want The current behavior makes it very hard to have 2 processes use the same store because if I remove an account from one process, I can't just read the data in and replace the in-memory cache. Which leads me to issue 2: Why is
|
@TylerLeonhardt is the MSAL authentication for vscode.dev planned for September as well? |
@lippertmarkus later today insiders.vscode.dev should be using MSAL. Assuming there are no major blockers, vscode.dev will get this as well. Please give insiders.vscode.dev a go after today. |
@TylerLeonhardt great, thanks! What do I need to setup in my app registration? Only have |
No sadly you need new ones... These in the SPA configuration: |
just tried it out and can confirm that it works fine, thanks! |
@lippertmarkus the build of insiders.vscode.dev that uses MSAL shouldn't be released yet. You'll see this if you go through the auth flow... the redirectUri will still say |
I enabled "Use MSAL" in the settings and then the CORS error I got before was gone but I'll just try again later |
Today it also works without enabling "Use MSAL" |
Summary of Statusvscode.devCurrent statusAs of 9/9/24, we have enabled using MSAL.js for all Microsoft auth calls in insiders.vscode.dev. Next steps
Open issuesNone, but to vent a bit we've had to workaround several MSAL.js bugs:
VS Code DesktopCurrent statusAs of 9/11/24, we have a fairly stable implementation of Microsoft Authentication using MSAL-node (vanilla, no broker). In order to use it, you must apply this VS Code setting: We did this so that we had a solution that used MSAL-node on all platforms. In other words, this will be the solution when there is no broker available. Next steps
Open issuesNone, but to vent a bit we've had to workaround several MSAL-node bugs:
VS Code CLI
|
Summary of Statusvscode.dev ✅Current statusAs of 9/9/24, we have enabled using MSAL.js for all Microsoft auth calls in vscode.dev. Next steps
Open issuesWe worked around AzureAD/microsoft-authentication-library-for-js#6829 but my suspicion is that we will need browsers to handle this better. VS Code Desktop 🏃Current statusAs of 11/27/24, we have a fairly stable implementation of Microsoft Authentication using MSAL-node that also uses the broker if it's available. This means that we currently support all security related measures that we can:
Next steps
Open issuesNone, but to vent a bit we've had to workaround several MSAL-node bugs:
VS Code CLI
|
moving to backlog as we are blocked on all remaining work |
Summary of StatusVS Code Desktop 🏃Current statusAdoption of the broker flow on Windows is done so from now on, you can assume that that is included in the Windows implementation. We had to rollback MSAL as we hit this issue: #229456 You can enable MSAL manually with: "microsoft-authentication.implementation": "msal" Next steps
Open issuesNot a blocker, but we have one issue that we still have a workaround for:
VS Code CLI
|
AAD Admins have the power to enforce logins of a certain kind that make our current OAuth flow insufficient for users to log in (it blocks it) and instead they have to log in using something like MSAL.js or msal-node.
Because of this, we should move to MSAL... but this is a challenge because:
The text was updated successfully, but these errors were encountered: