-
Notifications
You must be signed in to change notification settings - Fork 256
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
Enable CanShowDialog for .NET core Authentication Plugins #14010
Comments
It's not just .NET (Core), but MSBuild.exe as well. |
Team Triage: We should discuss with .NET partners and determine if we can set |
We chatted today and SDK and MSBuild are on-board. We see two parts to this work:
We think these two things can proceed in parallel - NuGet could consider shipping this for 17.14, while msbuild.exe and dotnet's changes (which are potentially more breaking?) may wait until .NET 10. The only thing we wanted to ensure was that after the change, the |
Adding message to better notify that the authentication is blocked and waiting for user interaction.  Coming in part for this ask: NuGet/Home#14010 (comment)
For the NuGet implementation we need to make sure that credential providers prepend [CredentialProvider], which msbuild uses to see if a message needs to be displayed right away. LogRequestHandler can be updated to take in a message prefix and prepend it to any messages that are logged, if it isn't already present. DefaultCredentialServiceUtility.GetCredentialProvidersAsync can be updated to always set canShowDialog to true. |
Those are unrelated. noninteractive is a CredentialService setting, can show dialog is something you tell the credential provider because it decides the type of interactivity. So just change canShowDialog to true and you're good. |
- CanShowDialog should be defaulted to true for the reasons outlined in NuGet/Home#14010 - If a system does not have the requirements to pop up a dialog (no browser support) the credprovider will fall through to device code flow.
NuGet Product(s) Affected
MSBuild.exe, dotnet.exe
Current Behavior
Currently, NuGet does not enable canShowDialog for .NET core authentication plugins. In these scenarios,
canShowDialog
is hard-coded to false in the defaultCredentialService. As a result, users with a .NET core NuGet authentication plugin backed by MSAL will be forced down device code flow instead of interactive authentication flow even if a pop up or browser auth is available and preferred.Desired Behavior
To help users avoid device code flow where possible, this behavior should be changed to allow the
canShowDialog
parameter to be passed by the user to .NET Core plugins. Additionally, the relevant dotnet cli NuGet commands and other .NET core integration points should be updated to pass thecanShowDialog
argument. This change will give users the flexibility to choose their preferred authentication method, enhancing both usability and security.Additional Context
Additional context to consider:
canShowDialog
option thereby degrading their experience.NUGET_CREDENTIALPROVIDER_FORCE_CANSHOWDIALOG_TO
(see here in the readme). However, we suspect this environment variable is not widely known, and setting environment variables instead of passing command line arguments is a disjointed experience for CLI users.The text was updated successfully, but these errors were encountered: