FredrikNoren / ungit

The easiest way to use git. On any platform. Anywhere.
MIT License
10.43k stars 636 forks source link

Keeps asking to login #442

Open kasajian opened 9 years ago

kasajian commented 9 years ago

When using Ungit with MIcrosoft's TFS 2013 Git server, ungit continually asks to login.

There's actually two problems.

  1. When I first launch ungit, it asks me to login. But I've not yet requested an operation that requires access to the server. Ungit should be able to use the local git repository without logging into the server. The login dialog doesn't have a cancel button. The workaround is to ignore the login dialog and hit the app's Refresh button, which will cause several errors to pop-up which you can then ignore. This workaround can be improved by adding a cancel button.

    This way, ungit can be used for read-only operations. This is useful when ungit is used as a visualizer, and other tools are used to do the actual work. In this way, you never have to log-in through Ungit.

  2. When logging in, there should be a way to retain the user-name and password, even if it's just for that session. I would rather not add my password in clear text to a configuration file. This is similar to how web-sites have "keep me logged in" option. That way, during that session, if the software requires credentials, it will use the ones in its internal cache (encrypted session storage).
  3. Interestingly, on the same computer as where ungit is running under node, if I use the git command line tools to access the server, I'm not asked to log in. I believe the machine has a git credential store or something. I'm not sure what ungit uses for its git access, but if it used https://gitcredentialstore.codeplex.com/ , or its just used whatever git was already installed on the computer, then things would just work.
FredrikNoren commented 9 years ago
  1. Yeah there's an auto-fetch each time you visit a repository with Ungit. It can be disabled in the configuration.
  2. I'm not sure how your setup looks like but I've usually circumvented that by using ssh instead of https. (I agree it would be nice for Ungit to be able to store credentials though, but there's all kinds of security concerns, as you mentioned, that comes with that so it's not a trivial task).
  3. Ungit overrides the default credential store (this is what makes it possible to relay the username/password question from git to the Ungit UI). It would be fairly easy to implement an option to disable that though, if that would help? (I assume that it would then just use the default credentials store). You can probably test if it solves it for you by commenting out this line https://github.com/FredrikNoren/ungit/blob/master/source/git-api.js#L113
kasajian commented 9 years ago

TFS doesn't support ssh. Only https. And yeah, I agree that storing the password in a session or global variable can be a security concern since anyone can walk up to the console and get to the data. Even if it's encrypted, if they are on that node, they can get to it.

I'll try your suggestion and let you know.

And thanks for the suggestion regarding disabling auto-fetch.

jung-kim commented 9 years ago

This would not help @kasajian but I'd imagine their are considerable amount of people who can benefit from ungit using keys found in ~/.ssh.

Is there any argument against this idea?

FredrikNoren commented 9 years ago

@codingtwinky Well git itself will try to use the local ssh-agent, which in turn uses the keys in .ssh, so in effect ungit already is using them (if you have everything correctly set up for using git)

rivaldid commented 8 years ago

With autofetch false ungit will not connect to the remote repository, but I'm wandering to have a readonly mode, I prefer handle my repository with the command-line interface. Any way to do this?

kasajian commented 8 years ago

i think this is a good idea. I think this product will actually get more interest if it had a "view-only" mode.

devendrainfotech commented 5 years ago

Any update on this??? for view-only mode

hepaestus commented 4 years ago

I am being asked to login over and over. Cannot successfully log in to Github.