简体   繁体   English

创建新工作区时出错

[英]Error creating a new workspace

I am trying to create a local workspace so I can map it to VisualStudio online account. 我正在尝试创建本地工作区,以便可以将其映射到VisualStudio在线帐户。 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 . 该命令确实具有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. 显然,即使使用Java客户端,也可能导致此问题。 Here is what Visual Studio Online has to say for it's questionable behavior. 这是Visual Studio Online因其可疑行为而不得不说的话。

Alternate authentication credentials 备用身份验证凭证

Some applications that work outside the browser (including Team Explorer Everywhere 某些在浏览器之外运行的应用程序(包括Team Explorer Everywhere)
command line client and the git-tf utility) require basic authentication credentials. 命令行客户端和git-tf实用程序)需要基本的身份验证凭据。 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. >请注意,不能使用备用凭据从Web浏览器或这些应用程序外部登录服务。


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. 我可以通过CLC使用Visual Studio联机凭据登录,但是当我尝试对Java程序执行相同操作时,出现身份验证异常。 Is there anything special that needs to be done for Java and / or Visual Studio Online ? Java和/或Visual Studio Online是否需要完成一些特殊的工作?

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

}

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\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)

If you're connecting to visualstudio.com from the cross-platform command line client, you need to set up and use " alternate credentials ". 如果要从跨平台命令行客户端连接到visualstudio.com,则需要设置并使用“ 替代凭据 ”。

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. 您不能使用Microsoft帐户(实时ID),因为-听起来很疯狂-仅通过向该网页提供密码才能起作用,并且我们不能依赖许多平台上存在的网络浏览器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM