I am developing a plugin for BitBucket to support our single sign on solution.
It’s a single-sign on solution for PKI cert integration. When a user goes to bitbucket rather than form authentication my plugin checks to see if there is a Crowd Token. If one does not exist bitbucket will redirect the user to our hosted single sign on application that reads the PKI certificate and authenticates them through crowd and creates an SSO Token. The application then redirects the user back to bitbucket where it can now read a valid Crowd token and authenticate the user. This all works through the web. However through git we are getting an error 501 Not Implemented when trying to clone repositories. We have configured git with the ssl cert and key, to store cookies for the crowd token, etc. And when I try to clone a repository through git I can trace in the BitBucket debug logs where the authentication is happening and it appears to be successful. However we are then presented with the error 501 Not Implemented.
I did some research but the only documentation I can find on this issue is this confluence page https://confluence.atlassian.com/stashkb/git-commands-return-error-code-501-282988872.html
I have verified that our git version is recent enough. The issue is that error 501 is vague and I'm not seeing a specific breakpoint in the debug logs, so anybody that has experience with this type of issue would be a great help.