public ICredentials GetCredentials(Uri uri, IWebProxy proxy, CredentialType credentialType, ICredentials existingCredential, bool retrying) { if (uri == null) { throw new ArgumentNullException("uri"); } NetworkCredential currentCredentials = null; if (existingCredential != null) { currentCredentials = Utility.GetCredentialsForUriFromICredentials(uri, existingCredential); } var form = new PlaceholderForm(credentialType, uri, currentCredentials); var result = GdkWin32.RunModalWin32Form(form, IdeApp.Workbench.RootWindow); return(result ? new NetworkCredential(form.Username, form.Password, form.Domain) : null); }
static ICredentials GetCredentialsFromUser(Uri uri, IWebProxy proxy, CredentialType credentialType) { NetworkCredential result = null; Runtime.RunInMainThread(() => { var form = new PlaceholderForm(credentialType, uri, null); if (GdkWin32.RunModalWin32Form(form, IdeApp.Workbench.RootWindow)) { result = new NetworkCredential(form.Username, form.Password, form.Domain); } }).Wait(); // store the obtained credentials in the auth store // but don't store for the root url since it may have other credentials if (result != null) { PasswordService.AddWebUserNameAndPassword(uri, result.UserName, result.Password); } return(result); }