aws-toolkit-jetbrains icon indicating copy to clipboard operation
aws-toolkit-jetbrains copied to clipboard

Add NuGet credentials provider for Code Artifact

Open davidmilne2017 opened this issue 3 years ago • 9 comments

Hello,

I seem to have an issue with maintaining a login to AWS code artefact repo.

Every day I login to the code artifact repo and get a fresh token and enter this in the password for the nuget source. This never works until I delete the source, close rider, reopen and readd the source. In addition if I now open another ide I have to follow the same steps.

It's unclear to me whether this is an issue with the plugin or the ide I welcome your feedback

Thanks


Toolkit: AWS Toolkit For JetBrains 1.38-212 OS: Mac OS X 11.6.4 IDE: JetBrains Rider 212

davidmilne2017 avatar Apr 04 '22 09:04 davidmilne2017

Hi @davidmilne2017

This seems to be an issue with the IDE rather than the plugin. We don't have any features relating to CodeArtifact currently, though providing a credentials provider for Code Artifact is possible. The Toolkit would be able to automatically refresh package credentials (assuming you had valid AWS credentials).

I'll mark this issue as a feature request for now. Feel free to add anymore details/info about your specific use-case.

JadenSimon avatar Apr 28 '22 21:04 JadenSimon

Hi @JadenSimon

Thanks for the response, this would be a very useful addition thank you

David

davidmilne2017 avatar Apr 29 '22 09:04 davidmilne2017

I agree with David,

The AWS Toolkit for Visual Studio offers similar functionality and is the current largest pain point in my team's transition to Rider from vs.

https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/using-aws-codeartifact.html

Will-Boulton avatar Apr 29 '22 09:04 Will-Boulton

I agree with David,

The AWS Toolkit for Visual Studio offers similar functionality and is the current largest pain point in my team's transition to Rider from vs.

https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/using-aws-codeartifact.html

Actually it looks like I'm wrong on this, but there is a cli command which will do what we're looking for for nuget:

aws codeartifact login --tool dotnet --repository <reponame> --domain <domain> --domain-owner <domain_owner>

Will-Boulton avatar Apr 29 '22 09:04 Will-Boulton

That cli command gets a token but unfortunately doesn't affect the ide, you still have to enter the code manually and it doesn't persist between ide instances

davidmilne2017 avatar Apr 29 '22 09:04 davidmilne2017

Looks like there is actually a cred provider for nuget, I am investigating now to see if it works as expected with rider.

https://docs.aws.amazon.com/codeartifact/latest/ug/nuget-cli.html

Will-Boulton avatar Apr 29 '22 09:04 Will-Boulton

Looks like there is actually a cred provider for nuget, I am investigating now to see if it works as expected with rider.

https://docs.aws.amazon.com/codeartifact/latest/ug/nuget-cli.html

It does not

DanSantimore avatar Oct 21 '22 13:10 DanSantimore

I have established how to get this working with Rider, the key is to change the way that Rider restores NuGet packages.

In the Settings window on Rider navigate to the NuGet sub-menu in the Build, Execution, Deployment menu.

Scroll down to the Restore section and set the PackageReference Restore Engine to MsBuild. This will force Rider to use MsBuild (and its plugins) to restore nuget packages.

Any sources setup using the nuget credential provider should now work in rider. https://docs.aws.amazon.com/codeartifact/latest/ug/nuget-cli.html

image

Will-Boulton avatar Nov 02 '22 09:11 Will-Boulton

Setting the PackageReference Restore Enging doesn't work for me. The issue it seems is that it isn't attempting to run the aws codeartifact login using the selected AWS profile. This is the case regardless of which setting I select.

jbzcooper avatar Dec 22 '23 13:12 jbzcooper