jenkinsci / jenkinsci/git-client-plugin
[JENKINS-33174] Support API token as credentials for git https (GitHub...)
- 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...)
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)
> 
Contributor guide
Assessment
This issue has not been assessed yet.