The behavior of the DomainProjectPicker control seems to have changed in the RC, and I want to understand the best way to handle it. I have been using this control in a standalone application that uses the TFS OM for months now to allow clients to choose a server and project, etc. The problem is, in the RC - due to what I assume are changes related to what you are discussing in this thread - the user is no longer prompted with the same credentials dialog (the one that allowed you to save your password.) Instead, they receive an error message when the DomainProjectPicker control's ShowDialog() method is called. I have read that the credentials management has indeed changed in the RC and that one should use the Control Panel's User Account applet's 'Manage my Network Passwords' feature (on XP) to get the same behavior that Beta 3 showed.
My server is on a workgroup (currently just named WORKGROUP), users may or may not be on a domain, AD or not.
Here's what happened in Beta 3:
ShowDialog was called on the DomainProjectPicker, and the 'Connect to Team Foundation Server' dialog came up. If the user had not previously authenticated or cached their credentials, they were prompted with the credentials dialog mentioned above. IF they saved their password, they were never prompted again for connections to this server.
In the RC, however, I (or the user) ALWAYS receive the following error message (assuming they have not cached a password in the Control Panel) when ShowDialog is called:
--------------------------- Team Foundation Server --------------------------- TF31003: Your user account does not have permission to connect to the Team Foundation Server mhtsctfsrc. Contact your Team Foundation Server administrator and request that the appropriate permission be added to your account. --------------------------- OK ---------------------------
Note that I NEVER receive a prompt for credentials...
DBGVIEW shows:
[3120] TFS::Authenticate : Caught exception : Microsoft.TeamFoundation.TeamFoundationServerUnauthorizedException: TF30063: You are not authorized to access mhtsctfsrc. [3120] at Microsoft.TeamFoundation.Client.TeamFoundationSoapProxy.ThrowIfUnauthorized(HttpWebResponse response) [3120] at Microsoft.TeamFoundation.Client.TeamFoundationSoapProxy.GetWebResponse(WebRequest request) [3120] at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) [3120] at Microsoft.TeamFoundation.Client.CheckAuthenticationProxy.CheckAuthentication() [3120] at Microsoft.TeamFoundation.Client.TeamFoundationServer.Authenticate(Boolean useProvider, ICredentialsProvider provider)
To get around it, I do the following:
[1] I click OK on the error message box [2] I get a 'Connect to Team Foundation Server' dialog with my server name in the Servers dropdown list, and no projects listed below it in the 'Team Projects' list [3] I click the 'Servers' button, the 'Add/Remove Team Foundation Server' dialog comes up [4] I try to add the same server to the list via the 'Add' button [5] NOW I get a credentials prompt, but one WITHOUT the 'save password' option that was there < RC
type user and password, hit Enter [7] I get: --------------------------- Team Foundation Server Exists --------------------------- Team Foundation Server '[my server]' already exists. --------------------------- OK ---------------------------
So, I remove the server using the Remove button [9] the server is removed [10] I add the exact same server back [11] I do NOT get a credentials prompt this time [12] the server is added to the list successfully [13] I click Close on the 'Add/Remove Team Foundation Server' dialog [14] Now, the Projects ARE filled in 'Team Projects' list and I can interact with the server as I did in Beta 3. [15] I have to do this EVERY TIME I RUN MY APP (well the removing and then re-adding the server part).
This seems kind of strange from a usage standpoint, especially since there is no indication to users (like a credentials prompt from the start) that they need to manually store their network password information for the server outside of the application using the Control Panel.
So, bottom line, the questions:
[1] Is there any way to get a credentials prompt for the server when using the DomainProjectPicker control like in Beta 3? I don't care that the new credentials dialog does not allow them to save their password, but getting an error message instead of simply prompting them for credentials every time seems incorrect and is causing a lot of confusion and discontent for my users who view it as a bug in my application.
[2] Should I be populating the 'Connect to Team Foundation Server' dialog manually? Is there any programmatic way to get around this problem via use of the TeamFoundationServer ctor or TeamFoundationServerFactory to do it so that users are prompted instead of getting error messages?
Thanks, and I apologize for the book of a post or if I have missed something obvious.
Cappy Popp
| | Cappy Popp | Any status, update, comment on this issue?
| | Cappy Popp | I have a similar problem. I have 2 machines in workgroup mode (non AD). If I run the following code from the client machine, it crashes:
>>>
DomainProjectPicker pjPicker = new DomainProjectPicker(DomainProjectPickerMode.AllowProjectSelect); ; pjPicker.ShowDialog();
<<<
Thanks in advance. | | jamil | I've contacted one of the owners of this code - you should get some help shortly.
Your friendly neighborhood hippie | | Tim Noonan MSFT | Hi Cappy,
Sorry for the late reply. The problem you experienced seems to be a bug introduced in TFS RC. Currently we don't have a good workaround for the problem and we are very sorry for that. We are working on a fix for the next release.
Jamil, the crashes you mentioned aren't related to the problem Cappy reported. If you still experienced the crash, could you capture the callstack?
Patrick Ng - Visual Studio Team Foundation Server | | Patrick Ng - MSFT | I just came across this thread through searching the web...
You can get around it by authenticating to the servers in the list prior to calling the dialog:
//first, make sure we are authenticated with all the servers (as this may be the first time we launch).
foreach (string server in RegisteredServers.GetServerNames()) { try { TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(server, new UICredentialsProvider()); } catch (Microsoft.TeamFoundation.TeamFoundationServerUnauthorizedException uaex) { // Handle the exception here... } } | | Joe Buys |
|