We have setup Siteminder for the SingleSignOn authentication for Bitbucket. Also, we have created a login form in Siteminder to manage the authentication for the users. It is working absolutely fine for us for logging into Bitbucket from the browser.
But when we try to use SourceTree to clone a repository from Bitbucket. It is creating problem.
We found in SourceTree there is feature to enable basic authentication. We have enabled basic authentication in Siteminder also so that it can accept the login credentials being send via basic authentication.
We tested it by using some curl command to fetch list of repos and projects from Bitbucket and it worked successfully.
But when we try to clone a repository in SourceTree by using basic authentication. it fails.
Though, it is able to create a remote account with basic authentication and is even able to fetch the list of the repositories. But when i try to clone it, it fails by hitting the Sitminder form.
Can someone please help to resolve this problem.
As you can see repositories listed and can create repositories from Sourcetree it looks like Sourcetree has stored good basic auth credentials.
However these actions all go via Bitbucket's REST API as HTTP requests.
The clone however is a Git command. Sourcetree should be sharing the good REST credentials with Git.
Is it possible that the Siteminder and Git are not configured to work together?
What happens if you try to do a git clone from the command line? I'm guessing it will prompt you for credentials, does the clone then work?
Finally are you using HTTP or SSH/GIT Urls for the Git repositories?
thanks for your reply.
You have asked very good questions. I will try to answer all of them.
1) Yes, Siteminder has been configurred to accept the basic authentication. i can say this with confirmation because curl command works absolutely fine. And, also sourcetree is able to fetch the list of the repositories. And now I know why. As you said, it uses Rest API and its same the curl command also uses to connect to Bitbucket.
2) We assumed that if Siteminder is set to accept basic authentication it would work for Git clone also. But I guess, i was wrong, it seems Git does not use basic authentication to clone the repositories.
3) Git clone fails from the command prompt. How can we make Git to clone via basic authentication ? No it does not prompt for the credentials. Infact, I even tried by giving username and password in the clone command itself. It looks like it get hit by the Siteminder form as it is not using basic authentication (i think so). Throws following error message:
asked for: https://<username>:<password>@bitbucket-xx.yyy.zo/scm/dev/sandbox-test-kchri.git/info/refs?service=git-upload-pack
4) We are using https to clone.
I'm glad we've narrowed down the problem, unfortunately I'm not sure how much help I will be beyond here as I have no experience of SiteMinder.
From the error you posted it looks like Siteminder is receiving on the requests started by Git, but it then trying to forward it to a login screen? It looks like it isn't acknowledging the username and password you prepended to the url.
As far a I know using HTTP with Git means it does just use normal HTTP constructs. As such I'd suggest it is something with your SiteMinder configuration.
Sorry I can't be of more use.
When you do find the solution, it would be great for the community f you could re-post it here.
Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events