NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 253 forks source link

Set NuGet Credential Provider CanShowDialog to true if NuGetInteractive is specified #13847

Open KirillOsenkov opened 2 days ago

KirillOsenkov commented 2 days ago

If the user does msbuild /r /p:NuGetInteractive=true I fully expect the NuGet Credential Provider to show the dialog instead of device flow for auth to Azure DevOps, at least on Windows.

However this here defaults it to false: https://github.com/NuGet/NuGet.Client/blob/9dd33574b0cf5110692ee8e9401a39857fb5523a/src/NuGet.Core/NuGet.Credentials/DefaultCredentialServiceUtility.cs#L64

If the user is specifying NuGetInteractive it's an explicit command that not only permits, but demands UI. Device Flow is awful in terms of UX.

There is a workaround, but it's obscure: set NUGET_CREDENTIALPROVIDER_FORCE_CANSHOWDIALOG_TO=true

This should be implemented for both msbuild as well as dotnet (perhaps nuget.exe too)

KirillOsenkov commented 2 days ago

See https://github.com/microsoft/artifacts-credprovider/issues/465 for details

microsoft-github-policy-service[bot] commented 2 days ago

Issue is missing Type label, remember to add a Type label