git-client-plugin icon indicating copy to clipboard operation
git-client-plugin copied to clipboard

[JENKINS-70897] Add support for personal access token authentication

Open Gagarmel opened this issue 1 year ago • 3 comments

JENKINS-70897 - Add support for personal access token authentication

On Bitbucket Datacenter/Cloud and Azure it is required to use personal access tokens instead of username/password authentication.

Resolves jenkinsci/bitbucket-branch-source-plugin#716

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. This is simply a reminder of what we are going to look for before merging your code.

  • [x] I have read the CONTRIBUTING doc
  • [x] I have referenced the Jira issue related to my changes in one or more commit messages
  • [ ] I have added tests that verify my changes
  • [x] Unit tests pass locally with my changes
  • [x] I have added documentation as necessary
  • [x] No Javadoc warnings were introduced with my changes
  • [x] No spotbugs warnings were introduced with my changes
  • [x] I have interactively tested my changes

Types of changes

What types of changes does your code introduce? Put an x in the boxes that apply

  • [ ] Infrastructure change (non-breaking change which updates dependencies or improves infrastructure)
  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Gagarmel avatar Feb 08 '24 20:02 Gagarmel

I've tested the changes by creating an organizational folder for project auto discovery. The token added in there as credentials discovers all projects/branches as expected, but the builds weren't able to checkout the repository. Tested it with a Windows build agent and Kubernetes cloud agents.

I'm also working on a PR in the git-plugin to pass the credentials in here. Otherwise this change will not work at all.

Gagarmel avatar Feb 13 '24 19:02 Gagarmel

does this need a corrsponding change for jgit, or is this unsupported there? if unsupported should this not be called somewhere?

I think that there is an alternate implementation technique that would add support for a standard credential and would work with both JGit and command line git.

MarkEWaite avatar May 11 '24 03:05 MarkEWaite

Please kindly add these changes.

habazie avatar Nov 21 '24 14:11 habazie

Hi, what is a status of this PR? Looks like it stuck. Is anything missing?

jangalda-nsc avatar Aug 20 '25 08:08 jangalda-nsc

does this need a corrsponding change for jgit, or is this unsupported there? if unsupported should this not be called somewhere?

I think that there is an alternate implementation technique that would add support for a standard credential and would work with both JGit and command line git.

Did some investigation and JGit, also does not support the token authentication at all

Gagarmel avatar Nov 09 '25 15:11 Gagarmel