Cloning a GIT repo from Azure DevOps with 2-factor authentication

azure

#1

We have a GIT based web-project that is stored in Azure DevOps, previously called VSTS, and want to use Katalon’s integrated GIT functionality that is based on EGit.
In Katalon, I choose ‘Clone Project’, fill in the URL, username and password and click next, Katalon is waiting for a reply. I get to the next screen with no branches shown. If I try to filter this list I get this error: “Unable to connect to Git Repository. Please go back and check your Git Repository URL, User and Password then try again.”

Katalon Studio is able to connect to the internet: for instance, it can activate its license and publish test results to Katalon Analytics. But I can’t get Katalon Studio to clone our GIT repository in Azure DevOps, even after this topic: Cloning a repo in VSTS issue that mentions creating a a Personal Access Token or using alternative credentials.

I think it might have to do with the two-factor authentication that we have in place. When using the command-line GIT tool, I get a Microsoft popup which asks me to log in and choose an extra authentication method. I could do that by using a phone text message, call or thru the Microsoft authenticator app. I don’t get that popup when trying to connect with Katalon Studio.
Can Katalon Studio or EGit handle 2-factor authentication or is it something else that’s blocking?


#2

We have a similar setup I’m trying to work through as well. We use Azure DevOps and have our authentication federated for Single Sign On through Okta / AD.

The only way I have successfully been able to get Katalon to connect to an Azure Git Repo was by enabling “Alternate Credentials” in Azure DevOps. From Azure if you go to your repo, and go to “clone” it gives an option to setup “Git Credentials”.

It basically seems like you can setup a different user/password that gets associated to same account (hence alternate authentication).

I got this working, but I don’t really like it. Because right on the Microsoft site it says:

“Use of alternate credentials is not recommended.”

However it doesn’t really explain why (but guessing its less secure).

I also tried setting up Git for Windows, and Git-Credential-Manager, which have built in support for the authentication patterns we’re talking about. I’m able to clone a repo from Azure via command line then, but what I can’t seem to do in that approach is get Katalon to use that Git configuration.

Not sure if any of this helps, but wanted to share my findings so far as we’re trying to get to same end result.


#3

Mike, thanks for sharing, appreciate it. Didn’t know that alternate credentials aren’t recommended. Good for you that you got it working though. Same here with the command line, that works flawlessly when trying to clone.

I followed the same steps when generating alternate creds (via the “clone” popup in Azure) but either that or generating a Personal Access Token doesn’t work when entering those creds in the Katalon form. That PAT might be something for you: maybe that is recommended over the non-recommended alternate creds? You can generate one by going in DevOps to your upper right user icon and “security”, then create one. In some other applications, you’re meant to leave the username empty when entering the PAT. Tried that with Katalon as well, no luck.


#4

I tried the PAT, entering that as the password in Katalon (leaving the username blank) and that worked for me. Feel much better about that than alternate credentials! Thanks for your help.

Sorry it’s not working for your 2-Factor setup…


#5

HI mleahy,

I am trying to use katalon for Azure DevOps, But i don’t know… how to katalon in Azure.

In My System i have prepared my scripts… those are working fine. But i need to use the same scripts in Azure DevOps.

Please provide your inputs how to start. If possible provide user guide.