-
Notifications
You must be signed in to change notification settings - Fork 258
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
NuGet cross plat authentication plugin #6486
Comments
Just an FYI: this already works cross-platform with JetBrains Rider's last preview version - www.jetbrains.com/rider/eap and with the existing plugin model, so wondering what work is left to do here other than hooking up a different executable to prompt for credentials? |
That’s good to know. Just curious: are you using a cross plat (.NET Core) credential provider or different versions for different platforms? |
FYI here's the announcement post we did: https://blog.jetbrains.com/dotnet/2018/03/06/credential-providers-private-nuget-feeds-rider-2018-1-eap/ We've plugged into the existing mechanism and are using a cross-platform JVM-based browser window + OAuth flow. Simple interface similar to what NuGet currently has:
(PS: in building 33 today in case you want to learn more) |
2 big questions on the new spec:
|
|
Ok, then 2 becomes interesting :-) |
There are currently no plans for a plugin to be started in process. We considered it but decided to go the standalone process route for a couple of reasons:
If you're using the client SDKs directly you have the ability to override the CredentialService itself. |
Ok so it is possible to override that one? |
Yes, it's normally setup by the application, not at the API level. |
Yes it's intended to be used by NuGet plugins authors... As Andrew suggested we can proceed with adding |
@nkolev92, another error was received while running NuGet restore on mono:
OS: Ubuntu 16.04 Under Verbosity logging NuGet.exe writes only "wintrust.dll" as a error message. Under which mono and os versions did you verified work of the commit NuGet/NuGet.Client@318ddad? |
@nkolev92, it looks on mono could be used the AuthenticodeDeformatter for signature verification. |
@dtretyakov |
@nkolev92, so as I understand in the mentioned change you've tried to disable plugins usage under any mono runtime? Or they work fine on mono in macos? If not maybe you could write meaningful message that plugin would not work under mono istead of this runtime exception? Do you have a feature freeze time in NuGet 4.8? |
@nkolev92 , @jainaashish another thought about change NuGet/NuGet.Client@318ddad#diff-e24eb77aabfdbad8c040b73608ca477b: it could be a breaking from the Plugins v1 perspective. They could start failing in NuGet 4.8+ on Mono runtime. |
@nkolev92, another significant problem is that NuGet authentication plugin is not used in
.NET CLI: 2.1.401-preview-009229 With NuGet 4.8.0 it works fine. Do you plan to address in the scope of .NET CLI 2.1.4xx? |
@dtretyakov Regarding the mono change, it's not breaking the V1 plugins since the V1 plugins used the fallback signature verifier (always failed validation), which means it's not any worse than before. |
@nkolev92 is it possible to use credential providers with |
Per @nkolev92 below, this should be possible with 15.8. |
Small correction. As part of the 15.9 previews, we have VSTS support within Visual Studio. |
List of current problems:
@nkolev92, @jainaashish, please let me know when these problems will be resolved. |
I'm planning on closing this issue, to properly reflect that it has shipped in this 4.8 milestone. @nkolev92 - can you please create/move remaining issues to 4.9 and 5.0 as appropriate. |
@rrelyea so whats the fix? How can I install dependencies from authenticated feeds? |
@phillip-haydon we've just released the Azure Artifacts Credential Provider. If you haven't updated to the required version of dotnet/nuget/msbuild (see readme), you can also use the old mechanism of a plain-text PAT: https://docs.microsoft.com/en-us/azure/devops/artifacts/nuget/dotnet-exe?view=vsts |
@alexmullans This may be a silly question, but does this work for non-Azure feeds? The linked repo description implies its Azure-specific. |
@bennettfactor the Azure Artifacts Credential Provider is specific to Azure Artifacts feeds. However, the plug-in mechanism that the Credential Provider uses to plug into NuGet/dotnet/MSBuild is generic. Another feed provider (e.g. MyGet) could write their own credential provider plug-in. |
@alexmullans @nkolev92 With just the Repro:
It looks like discovery is hardcoded to |
@maartenba Quickly skimming at your repro, you might be seeing #7438. |
Thanks, that helps! Our scenario is that we have desktop .NET targeted, running under Mono on Linux. So for discovery and launching, behaviour is based on the NuGet.Protocol target used? So full .NET can not launch a .NET Core provider? And vice-versa? (This also means [Edit] further investigation shows plugins are loaded based on the target framework NuGet.Protocol is compiled against. That's perhaps not ideal, but by plugging in some custom implementations for the IPluginResolver, this seems to work now. |
Spec: Implemented
This is a fork of #6410 to track related work for separate prioritization.
Users restore NuGet packages using a variety of codepaths and clients: Visual Studio NuGet Package Manager, NuGet.exe, dotnet(.exe), and msbuild /restore and /t:restore. We want to make it seamless to use authenticated feeds (e.g. from VSTS Package Management, MyGet, or Artifactory) in all of those codepaths, without the NuGet team or authenticated feed providers having to write duplicate auth code.
In addition, we want to bundle an authentication plugin with msbuild (when installed with VS or via the Build Tools SKU) and dotnet (when installed via the installer) so that VSTS auth works seamlessly on first run of e.g.
dotnet restore
, similar to how the Git Credential Manager automatically authenticates VSTS, GitHub, and Bitbucket users after a standard Git for Windows installation.As part of this work, we should investigate whether to move from the old VSTS NuGet Credential Provider, which is Windows-only, to standardize on the Git Credential Manager, which is cross-plat. And, we want to consider using @dtivel's plugin model (developed for large package support), so there's a single NuGet plugin model.
/cc @anangaur @emgarten @xavierdecoster
The text was updated successfully, but these errors were encountered: