App Connect

 View Only

 Eclipse git and azure devops oauth

Matthias Blomme's profile image
Matthias Blomme IBM Champion posted Tue June 17, 2025 02:39 AM

Now that Azure is phasing out PAT's (https://learn.microsoft.com/en-us/azure/devops/repos/git/set-up-credential-managers?view=azure-devops) for Azure Repos, I'm trying to get Eclipse to use the OAuth as default credential type.

This works for Git CLI, but I can't get it to work in Eclipse (with Eclipse JGit).

Anyone else that has tried this and either got it to work or gave up?

Matthias Blomme's profile image
Matthias Blomme IBM Champion

This is just not provided by the EGit/JGit plugin.

Where other plugins/tools delegate their Git commands to the system, JGit has implemented it internally and doesn't support (OAuth) Token based authentication. There is a topic open here: https://github.com/eclipse-jgit/jgit/issues/94

So until that plugin is update, a workaround is required. 

I did need to configure the system git to use OAuth for azure devops by setting the following properties (these set the Azure authentication to oauth and delegate the request flow to the system browser, make sure that one is not IE anymore)

git config --system credential.azreposCredentialType oauth
git config --system credential.msauthFlow system

Apart from that, I have created Eclipse launch files so we can still fetch, pull and push from within the Toolkit.

Just dropping the information here, should anyone ever run into the same issue.

Francois Brandelik's profile image
Francois Brandelik IBM Champion

Looking at git and the way to do upload / download operations (fetch, pull, push) aren't you supposed to use the git token as password?

In your git account, go to settings -> developer settings (at the bottom of the list) and expand that to access either a fine grained token or a classic token.

Choose what authorizations the token will have and generate it.  Copy the token because you'll have to regenerate it as you can't retrieve its value once you have left the generation screen.

The OAUTH methods should only be used with the browser type access.

Use the git token as a password in basic authentication to bypass MFA when calling the APIs. I am sure the Egit/Jgit plugin will take a git token as password.

Using the git token is the only way to use git fetch, pull or push from a Linux command line.

Hope it helps