创建新工作区时出错

时间:2014-07-26 03:46:59

标签: linux tfs azure-devops team-explorer-everywhere

我正在尝试创建一个本地工作区,以便将其映射到VisualStudio在线帐户。这是我试图运行的命令。

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

出于某种原因,我发现了一个错误。该命令确实有domain/user,pass。它要求我提供的这个新用户名和密码是什么?

Federated authentication to this server requires a username and password.

即使使用Java客户端,也会出现这个问题。以下是Visual Studio Online对其可疑行为所说的内容。

  

备用身份验证凭据

     

一些在浏览器之外工作的应用程序(包括Team Explorer Everywhere
  命令行客户端和git-tf实用程序)需要基本的身份验证凭据。   其他应用程序无法正确处理使用用户名的电子邮件地址   在身份验证期间。

     

要使用这些应用程序,您需要启用备用凭据,设置一个   密码,并可选择设置不以电子邮件地址形式的辅助用户名。 >请注意,备用凭据不能用于从Web登录服务   浏览器或这些应用程序之外。


这是我发布并被击落的另一个问题。只需记录在此以供将来参考


我可以通过CLC使用我的Visual Studio在线凭据登录,但是当我尝试对java程序执行相同操作时,我收到了身份验证异常。是否有任何特殊需要为Java和/或Visual Studio Online完成?

Java代码

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);
        }
    }

}

异常

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\venkatram.akkineni@gmail.com)
    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 个答案:

答案 0 :(得分:4)

如果您从跨平台命令行客户端连接到visualstudio.com,则需要设置并使用“alternate credentials”。

您不能使用Microsoft帐户(Live ID),因为 - 听起来很疯狂 - 只能通过向该网页提供密码来实现,而且我们不能依赖于许多平台上的Web浏览器。