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?

11 comments
Comment actions Permalink

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
Comment actions Permalink

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

0
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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

0
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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.

1
Comment actions Permalink

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

Please sign in to leave a comment.