Authenticating with Network Credentials

Mar 27, 2008 at 1:10 PM
Hi guys,

I have been working with the latest version and debugging through the code to see what my problem could be. At the moment SvnBridge does not prompt me to enter any network credentials when connecting to my TFS server. When I apply a username and password while in debug mode the credentials are applied successfully and another authentication box appears asking for a username and password again. I provide this and tortoise then successfully commits my work to the repository. I however only receive this issuse when trying to commit work, check outs and get latest are not a problem. Should SvnBridge be able to prompt for a username and password to use to authenticate against the TFS server?

Best regards,
Joel
Mar 28, 2008 at 2:05 AM
Joel,
I am afraid that I am not following.
Are you saying that you are able to commit to the repository using TortoiseSVN without entering user name & password?
Or are you saying that you can't do that?

SvnBridge will attempt to use the currently logged on user to commit to the repository, and only ask you for additional credentials if that is not enough.
Mar 28, 2008 at 6:33 AM
Sorry if I am sounding vague. At the moment I can do the following: Check out a project from TFS if I am logged onto the server through my Internet Explorer browser (Opening up Internet Explorer and visiting the TFS site portal where it prompts me for a username and password), so check outs are fine.

When I try to perform a check in I receive a authentication failure because by local username is not recognised on the server. It does not prompt me for additional information after that and only gives me the following error:

Error on handling request. Error id: 7180b351-a01a-4fdf-b08d-e0f48a0aa71e
System.Web.Services.Protocols.SoapException: TF14045: The identity JOELNB\Joel is not a recognized identity.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at CodePlex.TfsLibrary.RepositoryWebSvc.Repository.QueryWorkspaces(String ownerName, String computer)
at CodePlex.TfsLibrary.ObjectModel.SourceControlService.<>c_DisplayClass13.<GetWorkspaces>b_12()
at CodePlex.TfsLibrary.ObjectModel.SourceControlService.WrapWebExceptionT(WrapWebExceptionDelegate`1 function)
at CodePlex.TfsLibrary.ObjectModel.SourceControlService.GetWorkspaces(String tfsUrl, ICredentials credentials, WorkspaceComputers computers)
at SvnBridge.SourceControl.TFSSourceControlProvider.ClearExistingTempWorkspaces() in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\SourceControl\TFSSourceControlProvider.cs:line 357
at SvnBridge.SourceControl.TFSSourceControlProvider.MakeActivity(String activityId) in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\SourceControl\TFSSourceControlProvider.cs:line 347
at SvnBridge.Proxies.RemotingInvocation.Proceed() in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Proxies\RemotingInvocation.cs:line 71
at SvnBridge.Proxies.RetryOnSocketExceptionsInterceptor.Invoke(IInvocation invocation) in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Proxies\RetryOnSocketExceptionsInterceptor.cs:line 26
at SvnBridge.Proxies.RemotingInvocation.Proceed() in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Proxies\RemotingInvocation.cs:line 57
at SvnBridge.Proxies.ProxyFactory.RemotingProxy.Invoke(IMessage msg) in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Proxies\ProxyFactory.cs:line 44
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at SvnBridge.Interfaces.ISourceControlProvider.MakeActivity(String activityId)
at SvnBridge.Handlers.MkActivityHandler.Handle(IHttpContext context, ISourceControlProvider sourceControlProvider) in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Handlers\MkActivityHandler.cs:line 17
at SvnBridge.Handlers.HttpContextHandlerBase.Handle(IHttpContext context, IPathParser pathParser) in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Handlers\HttpContextHandlerBase.cs:line 30
at SvnBridge.Net.HttpContextDispatcher.Dispatch(IHttpContext connection) in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Net\HttpContextDispatcher.cs:line 73
at SvnBridge.Net.Listener.Process(TcpClient tcpClient) in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Net\Listener.cs:line 104
System.Web.Services.Protocols.SoapException: TF14045: The identity JOELNB\Joel is not a recognized identity.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at CodePlex.TfsLibrary.RepositoryWebSvc.Repository.QueryWorkspaces(String ownerName, String computer)
at CodePlex.TfsLibrary.ObjectModel.SourceControlService.<>c_DisplayClass13.<GetWorkspaces>b_12()
at CodePlex.TfsLibrary.ObjectModel.SourceControlService.WrapWebExceptionT(WrapWebExceptionDelegate`1 function)
at CodePlex.TfsLibrary.ObjectModel.SourceControlService.GetWorkspaces(String tfsUrl, ICredentials credentials, WorkspaceComputers computers)
at SvnBridge.SourceControl.TFSSourceControlProvider.ClearExistingTempWorkspaces() in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\SourceControl\TFSSourceControlProvider.cs:line 357
at SvnBridge.SourceControl.TFSSourceControlProvider.MakeActivity(String activityId) in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\SourceControl\TFSSourceControlProvider.cs:line 347
at SvnBridge.Proxies.RemotingInvocation.Proceed() in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Proxies\RemotingInvocation.cs:line 71
at SvnBridge.Proxies.RetryOnSocketExceptionsInterceptor.Invoke(IInvocation invocation) in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Proxies\RetryOnSocketExceptionsInterceptor.cs:line 26
at SvnBridge.Proxies.RemotingInvocation.Proceed() in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Proxies\RemotingInvocation.cs:line 57
at SvnBridge.Proxies.ProxyFactory.RemotingProxy.Invoke(IMessage msg) in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Proxies\ProxyFactory.cs:line 44
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at SvnBridge.Interfaces.ISourceControlProvider.MakeActivity(String activityId)
at SvnBridge.Handlers.MkActivityHandler.Handle(IHttpContext context, ISourceControlProvider sourceControlProvider) in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Handlers\MkActivityHandler.cs:line 17
at SvnBridge.Handlers.HttpContextHandlerBase.Handle(IHttpContext context, IPathParser pathParser) in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Handlers\HttpContextHandlerBase.cs:line 30
at SvnBridge.Net.HttpContextDispatcher.Dispatch(IHttpContext connection) in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Net\HttpContextDispatcher.cs:line 73
at SvnBridge.Net.Listener.Process(TcpClient tcpClient) in D:\Downloads\SvnBridge-17124\SvnBridgeLibrary\Net\Listener.cs:line 104

I therefore would like to have SvnBridge accept a username and password either through the URI or through username/password input fields so that the NetworkCredentials can be used to authenticate.

Best regards,
Joel

Mar 28, 2008 at 8:06 AM
Ayende,

I have spent some time now working through the code. It seems that the Authorization header always stays null.

Regards,
Joel
Mar 28, 2008 at 10:53 AM
What kind of SVN Client are you using?
Mar 28, 2008 at 11:03 AM
TortoiseSVN
Mar 28, 2008 at 7:36 PM
Joel,
Please use the information from TracingWithFiddler to gather a trace of what is going on and upload it.
Mar 31, 2008 at 11:39 AM
Edited Mar 31, 2008 at 11:57 AM
Hi all. I just want to say I have exactly the same problem...

Edit : Ok, i have done the job with TracingWithFiddler. Find it here :

http://lapajaparis.free.fr/Tempo/TrustyBadCredentials.saz
Mar 31, 2008 at 4:32 PM
Trusty,
I can't figure out what you are doing from the log, can you disclose that?
If you'll look at the log you sent, the last request is not sending the authorization info.
Mar 31, 2008 at 8:05 PM
Are the credentials for accessing your TFS server the same as what you are logging into your machine with? Or when you connect to TFS do you use a different login?
Apr 3, 2008 at 2:50 PM
Hi All,

Sorry for the late post. Really busy the last few days. I have in the mean time created a solution to this problem. I have added user credentials to the TFS URL and used them for authenticating against the server. Let me know if I should upload the code to the repo.

Cheers,
Joel
Apr 4, 2008 at 3:17 PM
Can you produce a failing test case for the behavior?
I am still not sure that I understand what is going on.
Even a batch script with SVN commands and explanation what the expected results is would be great.
Apr 7, 2008 at 7:20 AM
Currently I have the following configuration:

TFS 2008 Server on a Virtual Machine with Windows 2003 Server installed.
Virtual machine exists on a Windows 2003 Server as well.
Windows Vista client machine.
Windows workgroups are being used so there is no Active Directory and authentication therefore has to happen everytime I log onto a server.
When I run svnbridge it starts forwarding the http requests to my TFS box.
I then open Tortoise and perform a browse to my TFS repository. No authentication is performed at this point (No username+password box appears from Tortoise) and the browse fails.
I then browse to the TFS portal via IE7 and I authenticate.
I then try to browse again with Tortoise and I am now able to get the latest version of my project.
I now perform a edit on a file and open the checkin window of Tortoise.
All looks good and I hit checkin.
Tortoise now fails because no username+password was provided to log in even though I have autenticated via IE7 earlier. It seems that a commit works different from a get??
I then went a provided a username and password in the URL of the TFS pointed location.
I changed the GetCredential method to use this username and password to authenticate.
I try the commit again and it now works like a charm.

I will see if I can get a moment to generate a actual unit test for it. In the mean time I think the main issue here is that the machines are WORKGROUPED and therefore we get this authentication problems, give it a go on your end I think you should get the same result.




Apr 21, 2008 at 6:59 AM
Edited Apr 21, 2008 at 2:35 PM
Hi

Thanks for your answer. Your tool should be a great help to simplify the access to TFS source control.

My configuration is very different. We have a TFS 2008 server on a VPN at 600kms from us. I connect to it on my Vista Entreprise through our domain. My login/password for TFS is not the same as for my machine login.
All work well through Visual Team Explorer, asking me for login/password every day. Even my small utilities for handling solutions/projects files and 'get latest' during each night work perfectly.
SVNbridge accepts the connection at 'http://192.168.**.**:8080' with 8090 discussion port (8081 is already used by a proxy...), but the bridge or Tortoise never ask me for credentials....

Edit : RickHunter, can you give me your modified sources to be able to check in my case ?
Oct 30, 2008 at 1:58 AM
Experienced members,

I am also experiencing the same auth issues during commits. I would love to use this for my current project.

RickHunter, can you post or send me your version that allows for prompt for auth?

Thanks,

Chris
Nov 12, 2008 at 9:06 AM
Edited Nov 12, 2008 at 9:08 AM
I find a way to resolve this, but need you to change a piece of code:

locate the following file:
    SvnBridgeLibrary\SourceControl\CredentialsHelper.cs


Change the method "GetCredentialsForServer" to what you want, for example:

public static ICredentials GetCredentialsForServer(string tfsUrl, ICredentials credentials)
{
      return new NetworkCredential("admin", "test");
}


then compile the SvnBridgeLibrary project and replace the released SvnBridgeLibrary.dll with this one.
Enjoy...