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?

1
20 comments

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/?

0

Hi, has this issue been solved? I have the same problem.

0

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...

 

0

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 ⌘,.

0

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.

 

1

Hello Sofia. I am facing the same problem and tried your solution. Unfortunately the problem still occurs

0

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

0

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

 

 

0

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:

  • Linux - Ubuntu 21.04 with Gnome
  • Rider 2021.1.5
  • Developing solutions with .NET Core 3.1
  • Feed: https://my-company-name.pkgs.visualstudio.com/my-project-name/_packaging/my-feed-name/nuget/v3/index.json (parts in bold were redacted for my company's privacy.)

Objective:

  • Trying to get at custom NuGet packages from a custom feed in Azure DevOps (formerly VSTS) Packages/Artifacts.

What Did Not Work:

  • Rider would not prompt me for credentials 
  • Entering credentials in the Rider NuGet window Sources tab did not help
  • Manually editing the csproj to include a NuGet reference to a package on my custom feed did not help
  • File | Invalidate Caches did not help
  • Installing NuGet cli for Linux did not help
  • Changing Rider's NuGet settings under Credential Providers to "NuGet/.NET CLI Plugins, then Rider integrated" did not help (or... it didn't help by itself)
  • Restarting Rider after doing any of these various things did not help

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:

  • Used the Linux CLI to run "dotnet restore --interactive"
  • Before I modified my csproj file to manually add the reference to my custom package, it gave no indication anything was wrong
  • After I modified my csproj file to manually add the reference, it told me:

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.

4

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

0

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!

1

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

1

Hello Scottjgregory,

Could you please update Rider to install latest bugfix and check if the issue persists? 

Thank you in advance! 

 

 

0

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. 

0

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! 

0

The issue seems to have resolved itself for now. If it happens again I'll update you. 

0

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.

0

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!

1

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.

0

Please sign in to leave a comment.