Bug 52987 - XS constantly prompts for VSTS Package Source credentials
Summary: XS constantly prompts for VSTS Package Source credentials
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: NuGet ()
Version: 6.2.0 (C9)
Hardware: Macintosh Mac OS
: --- critical
Target Milestone: ---
Assignee: Matt Ward
Depends on:
Reported: 2017-03-02 20:24 UTC by Sasha Fahrenkopf
Modified: 2017-06-06 15:17 UTC (History)
2 users (show)

Tags: Cycle9I
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Sasha Fahrenkopf 2017-03-02 20:24:06 UTC
# Steps to reproduce
Add a VSTS Nuget Package Feed for a user with a VSTS PAT

# Expected behavior
Able to use packages from source without further authentication

# Actual behavior
Constant request for VSTS credentials

# Supplemental info (logs, images, videos)

# Test environment (full version information)
XS 6.2 (build 1821)
Mac OS Sierra 10.12.3
Comment 1 Matt Ward 2017-03-03 09:27:14 UTC
Not seen this behaviour before. I have used VSTS with a personal access token and I there were no prompts.

Can you provide the exact steps to reproduce this?

Also does it work from the command line using NuGet? Can you install/restore NuGet packages from the VSTS feed from the command line?
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2017-03-05 22:48:40 UTC
I will copy and paste 2 additional follow-up comments from the reporter of the bug and from Matt Ward that should ideally be included here.

* * *

### From the reporter of this bug (at 2017-03-04 00:20 UTC)

Follow up on the PAT issue: XS will be able to authenticate VSTS nuget feeds if you use the exact name for the package source that VSTS provides when you 'connect to feed'. If you try to name your source something that doesn't match the feed name as provided, authentication will fail.

* * *

### From Matt Ward (at 2017-03-04 11:24 UTC)

I am unable to reproduce Xamarin Studio 6.2 failing to authenticate with VSTS when the package source has a different name to the VSTS feed. I have VSTS package sources that have different names compared with the VSTS NuGet feed and it works for me although I may be doing something different. As long as the package source matches an item in the ~/.config/NuGet/NuGet.Config file where the username and password is defined then the authentication should work.

<?xml version="1.0" encoding="utf-8"?>
   <add key="VSTS NuGet v3" value="https://username.pkgs.visualstudio.com/DefaultCollection/_packaging/VSTSTest/nuget/v3/index.json" />
    <add key="VSTS NuGet v3" value="https://username.pkgs.visualstudio.com/DefaultCollection/_packaging/VSTSTest/nuget/v3/index.json" />
      <add key="Username" value="username" />
      <add key="Password" value="..." />

The NuGet.Config above uses spaces in one of the package source names which leads to the cryptic xml element inside the packageSourceCredentials section. The credential was originally created using the command line the VSTS page provides which was just doing a nuget sources add with some credentials. The package source name can be changed in that command line.
Comment 3 Lluis Sanchez 2017-05-18 11:09:18 UTC
Any update on this?
Comment 4 Matt Ward 2017-06-06 15:17:32 UTC
Going to close this one. There is another bug #56674 about repeatedly seeing the credentials dialog which I have a fix for. However that is not related to VSTS being used.