microsoft / artifacts-credprovider

The Azure Artifacts Credential Provider enables dotnet, NuGet.exe, and MSBuild to interactively acquire credentials for Azure Artifacts feeds.
MIT License
759 stars 707 forks source link

Device flow prompt did not appear with `dotnet tool install -g` #413

Closed DrChat closed 1 year ago

DrChat commented 1 year ago
> dotnet tool install -g --interactive --add-source=<redacted> <redacted>
C:\Program Files\dotnet\sdk\7.0.203\NuGet.targets(132,5): error :     [CredentialProvider]Device flow authentication failed. User was presented with device flow, but didn't react within 90 seconds. [C:\Users\<redacted>\AppData\Local\Temp\e9deb47a-b472-46fc-90ca-be3a21b5909c\restore.csproj]
C:\Users\<redacted>\AppData\Local\Temp\e9deb47a-b472-46fc-90ca-be3a21b5909c\restore.csproj : error NU1301: Unable to load the service index for source <redacted>.

I wasn't prompted via dialog or command-line to enter any credentials. After 90 seconds of waiting, it exited with the above error.

JohnSchmeichel commented 1 year ago

This is a known issue in recent versions of .NET tooling, see https://github.com/dotnet/sdk/issues/22987

The workaround is to pass --verbosity minimal on the command line to ensure the device code link and code are logged.

ahaleiii commented 1 year ago

Thank you @JohnSchmeichel for the workaround and context. Adding --verbosity minimal worked for me.

github-actions[bot] commented 1 year ago

This issue has had no activity in 90 days. Please comment if it is not actually stale.