This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 247839 - git login fails when origin url includes the username
Summary: git login fails when origin url includes the username
Status: RESOLVED WORKSFORME
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 8.0.1
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-09 16:11 UTC by rptmaestro
Modified: 2014-10-17 06:19 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rptmaestro 2014-10-09 16:11:18 UTC
When cloning my Stash git repository, I include my username as part of the repository url. This is a very common practice. For example:

[remote "origin"]
    url = https://rptmaestro@stash.example.org/scm/my-projects/sample.git

This is very convenient whenever I need to working from the command-line because the command-line client will see it already knows the user name and it will only prompt for the password.

However, the IDE code that is performing the authentication appears not to be able to handle having the username in the URL. For example, when I perform a push, the "Specify Git repository location" dialog appears. It seems to properly infer my username and it asks me for the password, but when I click ok, the same dialog comes back asking me for my password again. No matter how many times I attempt to authenticate, it fails with no message indicating why.

The only workaround at present is to remove my username from the remote "origin" url.
Comment 1 rptmaestro 2014-10-09 16:27:16 UTC
Additional notes for reproducing and working around this issue:


To Reproduce:
Initialize a new repository with a remote "origin" url that has username specified in the URL. Example:

[remote "origin"]
    url = https://rptmaestro@stash.example.org/scm/my-projects/sample.git


Workaround:
1. Remove the username from the remote "origin" url in .git/config
2. Restart the IDE (for some reason, it still won't work after removing the username until I restart the IDE. Perhaps the .git/config information is being cached in memory?)
3. Re-attempt the push and enter the username/password when prompted and select "Remember password". (It should succeed this time)
4. Edit .git/config to add the username to the remote "origin" url
5. Restart the IDE
6. On the next push, the IDE will remember the credentials from its previous successful attempt and will be able to complete the push successfully.
Comment 2 Ondrej Vrabec 2014-10-10 13:25:45 UTC
I cannot reproduce. True, NetBeans asks me in the dialog during the first push for username and password, but when i enter both username+password and selec Save Password, it successfully pushes and remembers the password for next pushes.
Are you sure you're entering corrent username + password into the auth dialog?
Comment 3 Ondrej Vrabec 2014-10-17 06:19:41 UTC
Are you sure you re-entered the username in the Username field? It is not enough to just see/enter it inside the URL. And please attach the IDE log after you click on cancel in the auth dialog (it will print informational logs).