Making Visual Studio TFS plugin store your credentials? - visual-studio

Every time I open Visual Studio 2008, I get a pop-up dialog prompting for my username and password ('Connecting to Team Foundation Server'). Presumably this is because I have my TFS server stored in the Team Explorer tab, in Servers, so it wants to connect to it on startup. In addition, this happens when I open a solution file whose solution is associated with TFS source control, for obvious reasons.
My problem is identical to that described in various places on the web, such as:
http://kevinsmi.wordpress.com/2009/10/07/getting-visual-studio-to-remember-your-tfs-credentials-on-windows-7/
http://social.msdn.microsoft.com/Forums/en-US/tfsgeneral/thread/186a469c-bc58-48c4-9db9-ffc2e0fedb11
http://hastobe.net/blogs/stevemorgan/archive/2008/08/25/stop-visual-studio-prompting-for-tfs-credentials.aspx
In all cases I can see, the suggested solution is to add the TFS server credentials to Windows' stored credentials. I'm using Windows 7, so I think the way you do that is in the Credential Manager.
Well, I've added the TFS server with my credentials to the 'Windows Credentials' list, and I still get the prompt for my username and password when I open Visual Studio 2008. Anyone have any ideas as to how I can get it to login with my credentials automatically?
UPDATE:
I added my TFS server's computer name, along with my username and password, into the Credential Manager (before I just had its IP address). Now, VS2008 does load without prompting me for credentials... but VS2005 still prompts me for them, even though it has the exact same server registered in Team Explorer! Whatsmore, the server registered in Team Explorer is the server's IP, which was already stored in Windows Credentials, rather than the server's name. So this is still a mystery. Could this be some registry setting peculiar to the VS2005 version of the Team Explorer source control plugin? Where in the registry could I find this potential setting(s)?

Did you even try to access TFS web site and enter your credentials to IE?
If you don't try, please try and check "Remember my credentials" checkbox.
I think this can solve your problem.

I found another way, check this article http://blogs.msdn.com/b/granth/archive/2010/10/17/getting-started-with-tfs-hosting-from-discountasp-net.aspx
and read Step 7,
may be this can be answer your problem.

For Visual Studio 2008, entering the credentials in the Credential Manager as I described above seemed to work.
I entered the server's IP address instead of its hostname in Visual Studio 2005 too, and at first it still prompted me for the username/password on startup. However, it has now stopped doing so. Maybe something needed to timeout? All I can say is, Visual Studio's TFS plugin works in strange (and undocumented) ways.

I had the same problem. The problem was that the TF-Server was not recognized being in the local intranet zone. So I added our TF-Server to the trusted sites in Internet Explorer settings and changed the user authentication in security level to automatically sign on with current username and password.

Related

TF30063:You are not authorized to access dev.azure.com but I can connect

I am using Azure Devops and VS2017 15.9.7.
I am logged into Devops and can sync.
When I open my project I get a message
"TF30063": You are not authorized to access dev.azure.com/myproject
I have tried going into credentials manager and deleting all the credentials for the devops organisation.
I have looked at this question and tried logging out via the browser within VS
TF30063:You are not authorized to access dev.azure.com but I can connect
I have encountered the same issue. (I need to switch back and forth between work account and test account). Of course, there could be so many reasons and it could be different for each (cached another account, or modified the password).
To resolve this issue I have two methods/steps.
Step 1 is to clear the credential from credential manager:
Go to Control Panel (with small icon view)-->User Accounts-->Manage your credentials (on the left column)-->Select Windows Credentials-->Scroll down to the Generic Credentials section and look for your TFS server connection.
Step 2 is to click on the operation that Connects to the Team Projects which is the button/plug icon in the Team Explorer tab. Then to also right click the project you are getting this issue on and select Connect:
I also have tried other methods but not work for me, if possible, you can check if it is useful to you:
How To Fix TF30063 Error
Error TF30063: You are not authorized to access
The comment by Kirsten Greed in the accepted solution resolved the issue for me. Reproduced here:
The problem was that I was opening the project using the Recent Project section of the start page. I closed VS, re-opened and then opened the project via "connect: in Team Explorer. Then exited. Now it seems to open ok either way.
I had the same issue, It solved by simply rerunning the Visual Studio as Administrator.
Running this command in cmd prompt, forces the re-authentication screen to come up and worked for me:
tf.exe get . /r
NOTE: you may need to locate tf.exe on your disk. For instance I have it at this location: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe
Another reason for this error is that you might have to re-enter your credentials in Visual Studio:
Restarting Visual Studio and connecting to Azure DevOps did the trick for me.
If the is problem like below:
The solution will be like below:
And after that select:
Re-enter your credentials
Step 1: Add
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer" in the environment variable path
Step 2: remove azuredevops org related credential from credential manager
Step 3: Delete this folder:
C:\Users<UserName>\AppData\Local\Microsoft\Team Foundation\7.0\Cache
Step 3:
run tf workspaces /collection:https://dev.azure.com/royalmailgroup in cmd
It might be the case of a password change.
In my case I had update my account password in a different machine. So on machine #02 I went to Visual Studio > Account Settings. After the pop-up opened, there was a message to re-enter credentials.
Sometimes the password isn't updated across all used app/services and you have to enter that manually.
Hope that helps.
None of the other methods above worked for me. I tried this in visual studio 2022 and it worked.
Open the Developer PowerShell (search for PowerShell) and type in the following:
TF vc permission
This will bring up a login screen and allow you to log in.
After that you should have permission.
In Visual Studio>Navigate to Tools > Nuget Package Manager >Package Manage Settings>Azure Service Authentication>Verify/Change the account
Leo Liu's answer got me on the right track. My problem could have originated from having two different Azure DevOps accounts cached in Windows Credentials and Visual Studio started choosing which one to authenticate with at random.
Log out of both accounts in Windows Credentials.
(The Manage Connections window does not have access to source control now.)
Open up the Azure DevOps website and logout there.
Login on Azure DevOps website.
(Visual Studio's Manage Connections can access source control again.)
What did it for me was open VS without code and connect via Team Explorer, but then also it threw the same error and after some time I logged out of azure web and tried connecting via Team Explorer again and it worked.

Access TFS from workstation that is not on a domain

Ok, so this is a little crazy:
I'm setting up an eval of TFS (not my first rodeo with TFS though -- just at a new place).
I have a VM server (server 2008r2/sp1, domain member)
I have a VM client running Visual Studio (Windows 7/SP1, not on the domain)
From the client, when I attempt to connect with either Visual Studio (2013/update4) or if I use IE11 to hit TFS Web Access, I am challenged for credentials (expected), but when I put in my domain creds, I get a 401!
However, if I use Chrome from the same VM to hit web access, I am challenged (expected), and my domain creds get me right in!
So:
Since it works with chrome, I have to assume that the vm is successfully connecting to the server, and that my account is set up with proper access to TFS.
However, I can't seem to fathom why it doesn't work from IE, or (more importantly), from Visual Studio.
Using TFS 2013/Update 4, BTW.
In a bout of desperation, I ran windows update, and applied all updates, including the optional ones. Solved. (or is that "Solved?")
For future reference, I did find this post while the updates were running. This would have been my next attempt: https://serverfault.com/questions/151753/integrated-windows-authentication-not-working-in-ie-only

Visual Studio 2012 won't let me log out of TFS so I can enter new username/password

I've been trying to disconnect or remove my credentials from a machine because of a conflict. However, whilst connecting to the remote TFS server I was asked for credentials, I cannot find a way to log out of the TFS and log in with new credentials to resolve. How can I drop the credentials or simply log into TFS as a different user. This is driving us crazy as we have a mapping conflict issue.
Currently the login to TFS and on VS is different from that of the machine. Is there a way I can just start again.
Check the Credential Manager:
Control Panel\All Control Panel Items\Credential Manager
There should be an entry for your TFS and your account. Just delete it and you should be asked again for credentials when connecting VS with TFS.
In my case the solution of Navanod didn't work.
What worked for me was adding the TFS-username to the TFS Server URL separated by the at-sign (#).
As follows:
The easiest way that I found for logging out of TFS from within Visual Studio is:
In Visual Studio select: View -> Other Window -> Web Browser
Type in your TFS Server URL in the URL Field (This means using VS, browse to your TFS url: MyName.visualstudio.com)
Sign out
Now if you try to connect to your TFS Server, VS would prompt you for Username and Password.

TFS in Visual Studio 2012 under Windows 8

I'm having trouble connecting to the hosted Team Foundation Service using Visual Studio 2012 RC.
Upon my first connect, a window was opened prompting me for my username and password, however I was added to TFS with a different Live ID. I've re-registered a new Live ID and now I can't get access to TFS. When I try to do so, I get this error:
TF31003
If you log out from All Live accounts in your Browser's and then try logging into TFS again you should be prompted for the credentials and you can login with the account that has access to TFS Preview.
I got the tf31003 error while trying to connect to a hosted TFS at https://mycompanyname.visualstudio.com/
I could access the site using my Live Id through Firefox but when trying to connect using VS 2010 I was getting that error.
The issue with my case was that VS2010 was trying to login using Internet Explorer which I was signed in under a different account. To solve this I opened Internet Explorer and logout from Hotmail/Live and went to the about URL and connected to the TFS instance, which connected successfully.
After that I went back to VS 2010 and tried to connect to the server again, this time I was shown the Login window where I was able to enter my login details. Once done my server was successfully added to the 'Team Server Foundation list' and was able to get the list of all my projects.
I had the same problem, except I am running VS2012 Update 2. This is overboard, but this is a thorough list of everything I did that eventually fixed it.
Ensured Visual Studio was not running
I opened Internet Explorer, pressed CTRL+SHFT+DEL, selected everything and clicked "Delete"
I opened Fiddler and navigated to "Tools > Clear WinINET Cache" and "Tools > Clear WinINET Cookies"
I opened the windows Credential Manager and removed all entries (including all Web Credentials, Windows Credentials, and Generic Credentials)
I disconnected my Microsofot account from my Windows account
Opened Visual Studio and connected to TFS, and it finally prompted me to login
Again, this is overboard, and not very surgical, but as I was in a hurry, so I decided to take the shotgun run, and it worked.
I had the same issue, the simplest solution I got was to delete just three cookies.
I found this recommendation in other post. It worked for me.
cookie:*#login.live.com/
cookie:*#visualstudio.com/
cookie:*#tfs.app.visualstudio.com/
To see the cookie files directly so to "Internet Options -> In the Browsing History Section Click "Settings" -> Click "View Files" -> They are all text files.
I received this same error (TF31003 / TF30063) when setting up a new TFS Build Server on Windows Server 2012 because Active Scripting was not enabled in IE.
In order to login - you must enable active scripting to see the login prompt below...
I actually discovered this after installing Visual Studio where the popup dialog specifically informs you of this required setting. Hopefully this will save sometime hours of lost time...

TFS/Visual studio 2010: Clear cached password for TFS in Visual Studio 2010, Need it to ask me to login again

I am using Windows 7 and i installed TFS Server and connected to it from my VS 2010 install. It prompted me for a password so I entered the admin password.
All went well, now i added myself as a user but i can't get it to ask me to login again. It is remembering (caching) the password. Hence it always logs me in as Administrator.
I search the Internet and some people recommend ClearCred.exe which ships with VS SDK but it doesn't anymore ...
And then checking the managed credentials in windows 7, i have also checked this and i see nothing with regards to my cached TFS password.
I also tried removing the TFS server connection from VS 2010 and readding it .. but it remembers me as Administrator.
Can anyone help?
Open the Start Menu and type "Manage Network Passwords" and open the control panel applet that shows up in the results. Then, you should see the credentials in the list where you can expand the item and "Remove from vault."
You need to remove TFS credentials from Windows Vault to clear and force to ask new TFS credentials in Visual Studio
Go to Control Panel (Start -> Control Panel).
Click User Accounts ( or User Accounts and Family Safety->User Accounts in Windows 7 Machine)
Click Credential Manager (or Manage your credentials)
In Credential Manager page, you can see the two type of credentials
i. Windows Credentials
ii. Generic Credentials
Click on two credentials modify link, click the link Remove from vault to remove stored TFS credentials.
Now, When you login into Visual Studio you will be asked to give credentials to connect TFS.
Note: Don't forgot to uncheck the option Remember my credentials to force to ask credentials for every TFS connections.
I had the same problem and after much googling found this link which fixed my problem i hope it works for you aswell.
http://www.richard-banks.org/2010/07/how-to-remember-my-password-with-tfs.html

Resources