This is a collection of common problems and resolutions related to authentication.

Preparation/general

log denotes directory inside the Settings Directory containing SmartGit's log files.

While resolving authentication-related problems, it's recommended to disable Detect remote changes option in the Preferences, section Background Commands to prevent background operations spoiling the log file with too many problems.

An independently opened terminal/shell refers to a terminal/shell which has not been opened through SmartGit:

Error: Authentication failed for '...'

Step "Check Command"

Check the Output view or the log-directory for the exact command which fails and try to invoke the command from an independently opened terminal/shell.

Step "Check Git-Shell"

Open a Git shell from within SmartGit: right-click the offending repository in the Branches view and invoke Open Git-Shell and try to invoke the command from this shell.

Step "Check Hosting Provider"

SmartGit's Hosting Provider configuration may interfere with the authentication.

Step "Check Windows AutoRun"

Command Processor AutoRun scripts may interfere with SmartGit's authentication hook. Open the Windows registry and check whether for key HKEY_CURRENT_USER\Software\Microsoft\Command Processor the value AutoRun is configured.

Step "Check Firewalls/Antivirus tools"

SmartGit is configuring Git with a small utility tool for password callbacks. Once invoked by Git, this tool is connecting to SmartGit using sockets to receive credentials. Firewalls/Antivirus tools may block this socket communication. This can been seen in the injector log files which will show up a java.net.ConnectException.

Sometimes firewalls/antivirus tools will only block SmartGit processes sporadically. In this case, you may see unexpected, redundant "Login" prompts. For details, see below.

Step "Check Credential Manager"

If you are on Windows and SmartGit as well as command line Git client simply fails without asking you for a password,

Step "Check Environment Differences"

Compare environment variables of the independently opened terminal/shell and the Git-Shell for possible differences

Step "Contact Support"

Send us a detailed description of the problem, including:

to [email protected]

Error: Could not read from remote repository, GitLab: the project you were looking for could not be found

Step "Check GitLab Configuration"

Go to your GitLab server configuration page (or ask your administrator to do so) and make sure that you have been granted all necessary access rights. You may start off with granting all possible rights and step-by-step reduce rights as long as you can still pull and push to the offending repository.

Error (Bitbucket): Server returned HTTP response code: 400 for URL: https://bitbucket.org/site/oauth2/access_token

Step "Check Bitbucket Configuration"

On the setup of the Bitbucket hosting provider, SmartGit has retrieved a "refresh" token which it is using subsequently to request short-lived "access" tokens. Under certain circumstances, this refresh token may become invalid. In this case, it will be necessary to recreate the hosting provider: go to the Preferences, section Hosting Provider, get rid of the Bitbucket hosting provider an re-Add the hosting provider.

Error (GitHub): Repository not found

Step "Check Command"

Check the Output view or the log-directory for the exact command which fails and try to invoke the command from an independently opened terminal/shell.

SmartGit only stores one pair of credentials for a single domain (e.g. github.com)

Step "Check Credentials Helper"

If:

this might be caused by having configured a Git credential.helper (probably in your global .gitconfig or in the system-wide .gitconfig). To resolve, you may set useHttpPath option, see https://git-scm.com/docs/gitcredentials.

Windows: Reoccurring "Login" prompts, usernames/passwords seems to become lost frequently

If you are receiving frequent "Login" prompts even your username/password haven't changed and you always tell SmartGit to store username/password, this may be caused by antiviral/firewall tools which are interfering the connection between the main SmartGit process and credential-helper processes. To resolve, try to exclude following executables from inspection by your antiviral/firewall tool. This is usually done by adding them to some trusted applications list:

Details on the interaction between SmartGit and Git's credential manager on Windows

If you have credential.helper=manager configured on Windows, Git will first invoke special code which tries to retrieve the password from the Windows Credential Manager.

  1. If the correct credentials are stored there, it's fine.
  2. If not, Windows will ask for credentials:
  3. If you will enter the correct credentials there, it's fine.
  4. If you will enter wrong credentials there, the dialog will show up again (back to step 2, this happens a couple of times).

    Up to this point SmartGit was not involved in the credentials prompt at all.

  5. If you cancel the dialog, Git will invoke the GIT_ASKPASS environment variable callback which is set by SmartGit.
  6. If the correct credentials are stored in SmartGit, they will be returned.
  7. Otherwise, SmartGit will show its own credentials dialog:
  8. If you will enter the correct credentials there, it's fine.
  9. If you will enter wrong credentials there, the dialog will show up again (back to step 7, this happens a couple of times).

    In either case, the credentials returned by SmartGit will be stored in the Windows Credentials Manager, too. Hence, subsequent requests for these credentials will be served directly from the Credentials Manager (step 1).


Debug logging: enable injector logging

To intercept Git credential prompts, SmartGit is "injecting" callback scripts. To enable debug logging for these scripts, perform following steps: