Using NuGet feed of private azure devops projects with oauth2 not working
I tried to use nuget feed of private project in rider. Using nuget.config to setup the feed works. At first try to get packages results in oauth2 window to enter my user credentials.
After autentification successfully, the list of available packages is empty. Using visual studio does work.
Does someone know this issue?
Please sign in to leave a comment.
Hi,
Could you please enable "NugetAll" tracing in the menu "Help | Diagnostic tools | Choose trace scenario", then reproduce this issue, collect all logs via "Help | Collect logs", disable tracing, and share the log bundle with us via creating a new support request or a ticket on Rider tracker https://youtrack.jetbrains.com/?
Hi, has this issue been solved? I have the same problem.
Hi,
Same here, same issue... When i added the new feed from dev.azure, it doesn't complain but first popped out an OAuth window which i fill successfully then nothing appears in the nuget feed...
I found this and it works for me :
https://www.jetbrains.com/help/rider/Using_NuGet.html#options
Credential providers for private NuGet feeds
JetBrains Rider lets you authenticate to private NuGet feeds that use with different authentication methods.
Authentication prompt for username/password combination
In the Sources tab of the NuGet window, you can edit or add a feed and add credentials in the form of a username/password combination.
The URL to private feeds is often shared with team members in the NuGet.config file that sits next to the solution file, so that everyone on the team can connect to such private feed. On the first load of such solution where package restore is required, JetBrains Rider will prompt for credentials.
When credentials are correct, they are stored in JetBrains Rider’s password store so that you don’t have to re-enter credentials each time you access a NuGet feed. The password store is configurable on the Appearance and Behavior | System Settings | Passwords page of the Settings/Preferences ⌘,.
Hello,
Please try the following scenario:
0) Check that the user you use to login to your NuGet Feed has permissions to read from the feed;
1) Restart Rider via the action "File | Invalidate cache / Restart | Invalidate and Restart";
2) Open your project and wait until you see a popup by Microsoft to enter your credentials;
3) Enter the proper credentials, switch to the "Packages" tab of the NuGet tool window, press "Refresh" button, wait until this process finishes, and check if the issue persists.
Please let me know about the results.
If found a solution installing GitHub - microsoft/artifacts-credprovider: The Azure Artifacts Credential Provider enables dotnet, NuGet.exe, and MSBuild to interactively acquire credentials for Azure Artifacts feeds. and change te setting in Nuget section
Hello Sofia. I am facing the same problem and tried your solution. Unfortunately the problem still occurs
Hi,
Can you please collect and share the following data in a new youtrack (https://youtrack.jetbrains.com) ticket?
- ~/.config/NuGet/NuGet.Config
- logs, collected with the enabled "NugetAll" tracing option in "Help | Diagnostic tools | Choose trace scenario". Enable it, then reproduce this issue, collect all logs via "Help | Collect logs", disable tracing.
Thank you in advance.
K.R.
Sofia
I had the same issue, I was using the device login instead of oAuth. Why it was not working for me was nuget.exe was not in the path.
I installed Azure Artifacts credential provider,
Downloaded latest version of nuget.exe
Added the location of nuget.exe to the path
I almost give up on Rider but managed to get the solution from Frankkubis to work. Details below in case it helps someone else.
Info:
Objective:
What Did Not Work:
The NuGet window Log tab just kept saying that I had cancelled the request to get the packages from my feed.
What Gave Me A Clue:
usr/share/dotnet/sdk/3.1.411/NuGet.targets(128,5): error : Unable to load the service index for source https://my-company-name.pkgs.visualstudio.com/my-project-name/_packaging/my-feed-name/nuget/v3/index.json. [/home/shaun/repos/my-company-name/my-solution-directory/my-solution.sln]
/usr/share/dotnet/sdk/3.1.411/NuGet.targets(128,5): error : Response status code does not indicate success: 401 (Unauthorized). [/home/shaun/repos/my-company-name/my-solution-directory/my-solution.sln]
Followed Frankkubis's link https://github.com/microsoft/artifacts-credprovider#azure-artifacts-credential-provider and followed the installation instructions for Linux.
Then, I performed a "dotnet restore --interactive" again from the Linux CLI. This gave me a URL to visit and a code to enter on the page. I followed the page, authenticated (to Microsoft) and entered the code. The .NET restore worked.
Finally, I restarted Rider. Now, the NuGet window Logs tab shows success and all of my custom NuGet packages show up!
I don't blame Jetbrains. I blame Microsoft. Microsoft LOVES to be convoluted.
Nevertheless, this should be a lot easier in Rider than it is. When I'm in the CLI, I expect to (and enjoy) have to do a lot fussing. When I'm in a GUI, I expect it to lead me on the garden path.
Otherwise, I'm loving Rider and loving being able to develop without the Windows VM.
Hi there,
Thanks to everybody who shared their workaround.
There is an issue on Rider's tracker for this problem: https://youtrack.jetbrains.com/issue/RIDER-63886. A dedicated developer is on it.
K.R.
Sofia
For those who are still having issues with authentication on linux: I wrote a simple script that uses the azure cli tool from Microsoft to automatically generate a PAT that lasts 1 year and then updates the NuGet credentials on your machine. The script can be found here: https://github.com/RektInator/azure-nuget-authenticate
I was unable to get it to work properly even with the Azure Credentials Provider. I had to re-authenticate every day in order to stay authenticated. This script authenticates you to the NuGet repository until the PAT expires. You must set the credential provider to "NuGet/.NET CLI plugins" in Rider.
I hope this helps!
has anybody got a fix on this for windows? Rider is becoming completely unusable. It will not restore packages from a private store located on a .visualstudio.com location. It also seems to not save the userpassword in the settings for nuget packages. Switch to Visual Studio it works fine 100% of the time.
If the creds dont work it just sits in a cycle loop promting the microsoft site link and a code. Almost ready to throw rider out of the window its becoming that bad. It only seems to have started since the upgrade to 2023.1
I've tried almost every workaround I can find. It occasionally works once I've closed rider opened visual studio restored packages and then opened rider again. That is seemingly working less and less!!
This is seeming the window I cant get rid of any more and it is just in an infinit loop
Hello Scottjgregory,
Could you please update Rider to install latest bugfix and check if the issue persists?
Thank you in advance!
I have the same problem and updated to the newest Rider version. It does go away after 4 tries, but the next time I try to refresh the package feed, the popup comes back.
Hello Lsm,
Could you please reproduce the issue and collect logs from Help > Collect Logs? Then please attach these logs to our shared storage at https://uploads.jetbrains.com and send me the upload ID.
Thank you in advance!
The issue seems to have resolved itself for now. If it happens again I'll update you.
I'm having the same issue with the latest version of Rider.
JetBrains Rider 2023.1.4
Build #RD-231.9225.23, built on July 17, 2023
This has been going on for months and months. It used to work with the EAP release, but that no longer works. Love the product, but it is completely unusable for me now. Sorry for the post here, but there are so many different bugs regarding this, I didn't know which one to reference.
Hello Whobday,
Thank you for your time spent leaving your feedback.
We are sorry to hear that you have run into such a problem.
Would you mind contacting Rider support via Help | Contact support, describing your problematic scenario in more detail and sharing a screenshot that demonstrates the issue?
Have a nice day!
I solved my problem by configuring a “Personal access tokens” from azure DevOps.
I give it “read” access for “Packaging”. The generated token is the password for the feed in Rider.
The user for the feed in Rider is my azure DevOps email account.