Error creating a new workspace

748 Views Asked by At

I am trying to create a local workspace so I can map it to VisualStudio online account. Here is the command I am trying to run.

tf workspace -new -login:"Windows Live ID"\user,pass -collection:https://shaggyinjun.visualstudio.com/DefaultCollection

For some reason I am seeing an error. The command does have a domain/user,pass. What is this new username and password it is asking me for ?

Federated authentication to this server requires a username and password.

Apparantly this is issue is caused even when using java clients. Here is what Visual Studio Online has to say for it's questionable behavior.

Alternate authentication credentials

Some applications that work outside the browser (including Team Explorer Everywhere
command line client and the git-tf utility) require basic authentication credentials. Other applications do not properly handle using an e-mail address for the user name during authentication.

To work with these applications, you need to enable alternate credentials, set a password, and optionally set a secondary user name not in the form of an e-mail address. > Please note that alternate credentials cannot be used to sign in to the service from a web browser or outside of these applications.


Here is another question that I posted and was shot down. Just documenting here for future reference


I am able to login using my Visual Studio online credentials via the CLC, but When I try to do the same with a java program, I get an Authentication exception. Is there anything special that needs to be done for Java and / or Visual Studio Online ?

Java Code

public static final String NATIVE_LIBS_SYSTEM_PROPERTY = "com.microsoft.tfs.jni.native.base-directory";
public void connect() {
        System.setProperty(NATIVE_LIBS_SYSTEM_PROPERTY, TFS_NATIVE_LIBS_HOME);        

        Credentials credentials = new UsernamePasswordCredentials("Windows Live ID\\user", "password");

        TFSConnection connection = null;

        try {
            connection = new TFSConfigurationServer(new URI("https://shaggyinjun.visualstudio.com/DefaultCollection"), credentials);
            connection.authenticate();

        } catch (URISyntaxException ex) {
            Exceptions.printStackTrace(ex);
        }
    }

}

Exception

com.microsoft.tfs.core.ws.runtime.exceptions.UnauthorizedException: Authorization failure connecting to 'https://shaggyinjun.visualstudio.com/DefaultCollection/TeamFoundation/Administration/v3.0/LocationService.asmx' (authenticating as Windows Live ID\user)
    at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequestInternal(SOAPService.java:709)
    at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequest(SOAPService.java:473)
    at ms.ws._LocationWebServiceSoap12Service.connect(_LocationWebServiceSoap12Service.java:384)
    at com.microsoft.tfs.core.clients.framework.location.internal.LocationWebServiceProxy.connect(LocationWebServiceProxy.java:70)
Caused: com.microsoft.tfs.core.exceptions.TFSUnauthorizedException: Access denied connecting to TFS server https://shaggyinjun.visualstudio.com/ (authenticating as Windows Live ID\[email protected])
    at com.microsoft.tfs.core.exceptions.mappers.TECoreExceptionMapper.map(TECoreExceptionMapper.java:75)
    at com.microsoft.tfs.core.exceptions.mappers.LocationExceptionMapper.map(LocationExceptionMapper.java:32)
    at com.microsoft.tfs.core.clients.framework.location.internal.LocationWebServiceProxy.connect(LocationWebServiceProxy.java:76)
    at com.microsoft.tfs.core.clients.framework.location.LocationService.connect(LocationService.java:754)
    at com.microsoft.tfs.core.clients.framework.location.LocationService.authenticate(LocationService.java:928)
    at com.microsoft.tfs.core.TFSConnection.authenticate(TFSConnection.java:748)
    at org.netbeans.modules.libswrapper.Installer.restored(Installer.java:54)
    at org.netbeans.core.startup.NbInstaller.loadCode(NbInstaller.java:471)
[catch] at org.netbeans.core.startup.NbInstaller.loadImpl(NbInstaller.java:394)
    at org.netbeans.core.startup.NbInstaller.access$000(NbInstaller.java:105)
    at org.netbeans.core.startup.NbInstaller$1.run(NbInstaller.java:346)
    at org.openide.filesystems.FileUtil$2.run(FileUtil.java:447)
    at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:127)
    at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:609)
    at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:431)
    at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:451)
    at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:343)
    at org.netbeans.ModuleManager.enable(ModuleManager.java:1194)
    at org.netbeans.ModuleManager.enable(ModuleManager.java:1017)
    at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:340)
    at org.netbeans.core.startup.ModuleList.access$2400(ModuleList.java:118)
    at org.netbeans.core.startup.ModuleList$Listener.stepEnable(ModuleList.java:1409)
    at org.netbeans.core.startup.ModuleList$Listener.access$1400(ModuleList.java:1007)
    at org.netbeans.core.startup.ModuleList$Listener$1.run(ModuleList.java:1231)
    at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:127)
    at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:609)
    at org.netbeans.core.startup.ModuleList$Listener.run(ModuleList.java:1207)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
1

There are 1 best solutions below

0
On BEST ANSWER

If you're connecting to visualstudio.com from the cross-platform command line client, you need to set up and use "alternate credentials".

You cannot use a Microsoft Account (Live ID) because - crazy as it sounds - that only works by supplying passwords to that web page and we cannot rely on a web browsers existence on many platforms.