if you are trying to connect to team foundation server online through visual studio and you get unauthorized excetion.
first make sure you have got access to that account and if you do then it most probably must be because of a cached microsoft account which does not have access to the collection. to fix this:
- Open visual studio
- using a visual studio built in browser, navigate to http://tfs.visualstudio.com
- Sign out of the exisiting logged in account
- Log in using the microsoft account which has got access to the collection
- and you are good to go.