jenkinsci / jenkinsci/git-client-plugin

[JENKINS-33174] Support API token as credentials for git https (GitHub...)

Open
#1,507 7 comments 0 reactions 0 assignees View on GitHub
component:git-client-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
152
Forks
402
Avg merge
6h 47m
Merged PRs (30d)
4

Description

GitHub recommends for git+https to use API tokens instead of username & password.

GitHub API token can be passed as a real token (https://@​github.com/username/bar.git) or as the username of a username:password auth (https://:@​github.com/username/bar.git).

The client-client-plugin only supports username-password credentials for the moment (see o.j.p.gitclient.CliGitAPIImpl#getGitCredentialsURL()).

Using a username-password-credentials storing the token in the username field is not a valid workaround as the GitHub API token is revealed in the GUI (see attached screenshot).

Could we add support for Token as credentials for git+https and, if possible, introduce a credentials named "Token" as this name is more intuitive than "Secret Text".

---
Originally reported by cleclerc, imported from: Support API token as credentials for git https (GitHub...)


  • status: Open
  • priority: Minor
  • component(s): git-client-plugin
  • label(s): plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 2
  • imported: 20251211-071809

Raw content of original issue

GitHub recommends for git+https to use API tokens instead of username & password.

GitHub API token can be passed as a real token (https://<token>@github.com/username/bar.git) or as the username of a username:password auth (https://<token>:@github.com/username/bar.git).

The client-client-plugin only supports username-password credentials for the moment (see o.j.p.gitclient.CliGitAPIImpl#getGitCredentialsURL()).

Using a username-password-credentials storing the token in the username field is not a valid workaround as the GitHub API token is revealed in the GUI (see attached screenshot).

Could we add support for Token as credentials for git+https and, if possible, introduce a credentials named "Token" as this name is more intuitive than "Secret Text".

  • environment: Docker Pipeline 1.14

1 attachment

- [jenkins-git-step-github-api-token.png](https://issues.jenkins.io/secure/attachment/32050/jenkins-git-step-github-api-token.png)
> ![jenkins-git-step-github-api-token.png](https://issues.jenkins.io/secure/attachment/32050/jenkins-git-step-github-api-token.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.