Add NuGet credentials provider for Code Artifact
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
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.
Hi @JadenSimon
Thanks for the response, this would be a very useful addition thank you
David
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
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>
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
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
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
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

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.