Skip to content

Problem authenticating through Active Directory #1048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lossurdo opened this issue Aug 19, 2020 · 1 comment
Open

Problem authenticating through Active Directory #1048

lossurdo opened this issue Aug 19, 2020 · 1 comment

Comments

@lossurdo
Copy link

My company authenticates its Azure DevOps git repositories on Windows Active Directory. So I have to add domain name to correctly authenticate and clone repositories.

Like this:

test = "https://domain\\user:pass@mycompany.com/tfs/.../my_repo"
repo = git.Repo.clone_from(test, temp_dir, env={"GIT_SSL_NO_VERIFY": "1"},
                           branch='master', depth=1)

And I got this error:

fatal: unable to access 'https://domain/user:pass@mycompany.com/tfs/.../my_repo/': Empty reply from server

Notice that the backslash right after the domain has been replaced by a slash. Probably the problem is related to this function python cmd.polish_url() and this line [327] url = url.replace("\\\\", "\\").replace("\\", "/").

My environment is:

  • gitpython-3.1.7
  • Python 3.8.2 - Windows 10 64bits

Thank you in advance.

@Byron
Copy link
Member

Byron commented Aug 20, 2020

GitPython handles URLs absolutely incorrectly, and it feels like hack on hack just to fix one particular problem.

In that tradition… :D … and after having read the comment I think this code exists to handle paths in particular, like c:\git-repo.

In order not to break that, we could check if a scheme is present and if so, assume a valid URL. If some other problem surfaces from that, I guess that will be fixed separately.

Please feel free to submit a PR for this kind of solution to get this problem fixed soon.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants