-
Notifications
You must be signed in to change notification settings - Fork 909
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
Would it be possible to add Credential Provider support? #1721
Comments
We are looking to move to v3+ this year (hopefully, barring any further issues). So that should be able to bring this with it. |
Related to #508 |
@ferventcoder any updates on this? I have a nupkg hosted on an internal authenticated server and I can access it through nuget but not through choco |
Yep, I'm also looking for a solution to this problem. Would be great if choco can offer that |
Btw, by default nuget asks for credentials, but nuget saved token is valid for 4 hours. (Seriously Microsoft ? Seriously ???) Personal authentication token is valid for 1 year. Maybe using credentials provider is not worth of effort of implementing it. |
After couple of debug sessions on https://github.com/microsoft/artifacts-credprovider - I've realized that you need to use netfx version to get UI prompt and special environment variable to suppress device credential prompt (visit url, seriously ?) Attaching here whole code to be able to authorize nuget and choco feeds. For choco feed you will need either my patch or reconfigure choco manually. Here is whole powershell example if anyone cares to use it. Generated personal authentication token should be valid for 1 year, but that value can be extended - I've managed to get even for 5 years. (From web page it's not possible)
|
Btw https://devblogs.microsoft.com/devops/new-personal-access-token-lifecycle-apis-in-private-preview/ there exists also API to create personal access tokens - but what I've briefly tested - it did not work for me. Meanwhile - |
Is there any update on this? |
@padillah look at the issue labels for the status of an issue. Specifically, this issue is still in triaging, so it is undecided if this feature would be added to Chocolatey CLI. As for this issue specifically, #508 was completed, and will be release with v2.0.0 of Chocolatey CLI. So this issue would then be unblocked and potentially could be added in a release after v2.0.0, as #508 is a prerequisite for this feature. |
You'll have to forgive me for wondering if something that hasn't had so much as a comment in two years may have fallen by the wayside. |
what is left to complete this? i am interested in working on this |
@mgrandi you will probably want to look at Given that Chocolatey CLI uses the NuGet Client libraries, it may help to look at the different implementations of Some thought and discussion probably needs to go into how additional providers are added/configured/enabled/disabled/installed/discovered/etc. I don't know enough about them to really have an option yet. Also, given that this issue is still under triaging, a PR may not be accepted if the Chocolatey team determines this is outside the scope of what should be added to Chocolatey CLI. |
NuGet 3 and later supports the Credential Provider, which automatically acquires feed credentials when needed but Chocolatey still uses v2.
I'm especially interested in CredentialProvider.Vss.exe support since I'm hosting my Chocolatey packages on internal Azure DevOps feeds.
I know that I can:
Use PAT and V2 but it's super cumbersome for the users. First, they have to obtain a token and then use it by adding to the config file or explicitly in the commands.
Wrap choco calls into a custom command line tool which could call CredentialProvider.Vss.exe first and then call choco.exe with the JWT obtained. But again, it looks like a workaround.
The text was updated successfully, but these errors were encountered: