aws-codeartifact-proxy icon indicating copy to clipboard operation
aws-codeartifact-proxy copied to clipboard

Nuget header not adding Authentication

Open ahovelmedstudy opened this issue 2 years ago • 5 comments

Hello and thank you for your work on this.

We're trying to use nuget to push artifacts. The container starts and we get the Authorization successful result. When we attempt to nuget push or install we get a prompt for credentials. Looking at the code and doing some packet captures to try and find the issue.

ahovelmedstudy avatar Aug 31 '22 01:08 ahovelmedstudy

Did you ever figure out what was going on with this? Running into the same error...

SeanGrady avatar Nov 08 '22 20:11 SeanGrady

I can also confirm that this project does not work for NuGet. As I understand it this is because unlike e.g. npm or pip, NuGet uses a handshake protocol for authentication rather than just plain HTTP auth. To be able to proxy NuGet packages from an upstream repository that requires authentication, one would need the proxy server to implement some (if not all) of NuGet's client-side authentication flow.

Here are some relevant resources describing how NuGet auth works:

lafrenierejm avatar May 01 '23 16:05 lafrenierejm

Any chance of actually supporting nuget?

emboss64 avatar May 18 '23 10:05 emboss64

Any chance of actually supporting nuget?

I'll have to read up on how the nuget authentication works and do some testing. At the moment, I don't use any .NET languages or even have Visual Studio installed so will have to make a "mock" project to test it.

sktan avatar Jun 05 '23 00:06 sktan

I know this has been sitting out here for a while, just worked through this today. Can confirm that doing something like https://github.com/arinet/aws-codeartifact-proxy/commit/5ef6a633233584df41a61265aa34bc02f1bab6f8 resolves the issue. Don't be like me and bang your head into a table not realizing that VS's nuget instance caches the responses; when you test, do yourself a favor and either flush that cache or invalidate it by changing the proxied source name, host, or port. I likely spent a few extra hours on this today confused as to why it wasn't working, only to come to the conclusion it was cached. Upon flushing that, everything magically started working as expected.

jrlost avatar Nov 03 '23 21:11 jrlost