Comments (15)
Makes sense.
If the auth failed because of a timeout (user never entered anything), it would be nice to have a clear error message at the end ("User was presented with device flow, but didn't react after X seconds"). So we know why auth failed.
from artifacts-credprovider.
The plugin itself does not have control over the color schema of the logging since the nuget tools write the output.
You can however change the content of the log message to make it pop a bit more.
Potentially you could log at a warning level that would change the color of the output, but that's a misuse.
from artifacts-credprovider.
As a side-note, there's been requests/suggestions that device flow should be the experience every time. (Even NuGet.exe)
//cc @loic-sharma
If the auth failed because of a timeout (user never entered anything), it would be nice to have a clear error message at the end ("User was presented with device flow, but didn't react after X seconds"). So we know why auth failed.
I think the plugin should/can handle that.
from artifacts-credprovider.
@KirillOsenkov There is no way to do that.
By design MSBuild will never allow plugins to pop-up a dialog.
This was a decision made jointly between NuGet and @jeffkl and @AndyGerlicher.
We thought it's important that the host (msbuild,dotnet.exe) makes the decision on what the experience will be like.
//cc @rrelyea
from artifacts-credprovider.
@KirillOsenkov we didn't like the idea of a command-line tool like MSBuild.exe
popping up a dialog and opted to use device flow instead which prompts in the same command window. Do you not like this approach?
from artifacts-credprovider.
I'm taken by surprise that this was a deliberate decision ;)
What is happening is you're pausing the build and prompting for user interaction via device flow, and then fail after a certain timeout if user didn't auth. So in a way it is already interactive, just not showing a dialog.
But the unfortunate UX of this is the user launched the build, specified /p:nugetInteractive=true, fully expecting a dialog to pop up, and switched away to reading Twitter, waiting for that dialog. The device flow prompt was buried in a sea of random output, and after I get tired of Twitter I switch back to MSBuild only to find out that the auth failed for some unknown reason.
I certainly understand that MSBuild showing dialogs sounds nonsensical, however I'd rather have that than the device flow experience, honestly. Two improvements come to mind:
-
Highlight the device flow prompt using a bright console color, surround with ASCII frames and make sure it's the last thing in the MSBuild output console, and not buried in random output.
-
Allow the user to pass a property to switch to the auth dialog if they so choose. You can keep device flow as default, if it is more discoverable. But there needs to be an option at least.
from artifacts-credprovider.
I personally expect all prompts to come from the command window itself. I've had command-line tools pop up dialogs and sometimes they appear behind my windows which is bad. They also cannot be made modal so I can bring the command window back to focus and not know that it has popped up this other unrelated window.
I think the biggest reason we didn't want to pop up a dialog is because MSBuild is cross platform and we wouldn't be able to open a consistent looking dialog on the various platforms. This means that MSBuild.exe
would pop up a dialog while dotnet msbuild
would not, even on the same machine. Even if we made MSBuild pop up a dialog on Windows only, I think it would be bad if I had a different experience on a Mac or Linux machine. The device flow experience is at least consistent across all platforms. When running inside Visual Studio, you get a dialog as you'd expect since you're running in a UI.
Currently, MSBuild has no concept of "prompts". The messages are simply logged as high importance messages. We could potentially add another logging level to make it a different color. If we don't care about the color, we could change the overall look of the prompt inside this credential provider. I'd definitely be behind a change to the text of the prompt as we just released it and its a good time to revisit if people have feedback.
from artifacts-credprovider.
There's also a similar issue regarding the visibility of the messaged raised on NuGet's repo. NuGet/Home#7364
So that is something that we can definitely improve.
As far as the client is concerned, currently that is a generic log message, so the easiest thing would be for the plugin to add some pretty print around it.
from artifacts-credprovider.
Adding bright colored logging around the device flow prompt is a good idea. I've added it to our back log.
from artifacts-credprovider.
Also, still I think it'd be nice to have an option to turn the dialog on from MSBuild, maybe by passing another property. So if the user explicitly chooses the dialog instead of the device flow, they can get to it, even if it's just available on Windows.
from artifacts-credprovider.
Also, still I think it'd be nice to have an option to turn the dialog on from MSBuild,
@KirillOsenkov What would the expected behavior be if you were on a Mac or Linux machine or .NET Core and we can't open a UI dialog?
from artifacts-credprovider.
@jeffkl Fall back to device flow
from artifacts-credprovider.
Tagging this as duplicate of NuGet/Home#7364.
from artifacts-credprovider.
The latest version of the credential provider has some additional attention tracking print around the device flow prompt. https://github.com/Microsoft/artifacts-credprovider/releases
from artifacts-credprovider.
Closing this as the duplicate issue is closed and we've improved the visibility of the device flow request.
from artifacts-credprovider.
Related Issues (20)
- Nu
- Azure Artifacts Credential provider failing to start HOT 6
- NullReferenceException in v1.0.9 HOT 3
- Azure Devops: gzip: stdin: unexpected end of file HOT 3
- Problem starting the plugin - Broken Pipe HOT 1
- How to do enhanced debugging? HOT 1
- Issue authenticating to Azure Artifacts via Python behind firewall decryption HOT 1
- Use Windows authentication context from in WSL HOT 6
- System.Security.Cryptography.CryptographicException on remote connections HOT 9
- The last Create 1.1.0 release Build Failed. When v1.1.0 will be released? HOT 6
- The messages logged by the credential providers are not localized. HOT 3
- Inconsistent account selection modal behavior across operating systems HOT 3
- MsalInteractiveTokenProvider breaks if no console window handle available HOT 4
- Artifacts Conda Remove SDK Dependency HOT 2
- Credential provider is not working on new laptop HOT 4
- `JsonException` with Release `1.1.0` when using `VSS_NUGET_EXTERNAL_FEED_ENDPOINTS` HOT 4
- dotnet list <SOLUTION> package --vulnerable/--outdated/--deprecated fails with Azure Artifacts Credential Provider HOT 7
- Are the Requirements Correct? HOT 4
- The proxy tunnel request to proxy failed with status code '407' HOT 1
- .NET 8 is not supported yet
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from artifacts-credprovider.