jenkinsci / jenkinsci/jfrog-plugin
jfrog plugin using access token not working
- Dominant language
- Java
- Stars
- 16
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
### How can we help?
Looks like this issue is explained in https://github.com/jfrog/jfrog-cli/issues/1616#issuecomment-1217734448
I can configure the plugin with user and password and all is fine. But when I use an access token the job fails with Unauthorized:
(All hostnames and account info removed)
The plugin runs this in the jenkins pipeline:
/usr/local/bin/jf c add artifactory --user=x --password x --url=xxxx --artifactory-url=https://xxxx --distribution-url=https://xxxx/distribution --xray-url=https://xxxx/xray --interactive=false --overwrite=true
[jenkins@john-jfrog-test ~]$ /usr/local/bin/jf rt ping
10:04:38 [🚨Error] server response: 401 Unauthorized
{
"errors": [
{
"status": 401,
"message": "Bad credentials"
}
]
}
[jenkins@john-jfrog-test ~]$
**Adding the workaround from issue 1616 resolves the issue from the shell but how do I implement these options in the plugin?
"--enc-password=false --basic-auth-only"**
/usr/local/bin/jf c add artifactory --user=x --password=x --url=https://xxxx --artifactory-url=https://xxxx/artifactory --distribution-url=https://xxxx/distribution --xray-url=https://xxxx/xray --interactive=false --overwrite=true --enc-password=false --basic-auth-only
[jenkins@john-jfrog-test ~]$
[jenkins@john-jfrog-test ~]$ /usr/local/bin/jf rt ping
OK
jf version 2.34.1
JFrog Plugin Version1.0.5
Thanks.
Contributor guide
Research direction
Start by tracing how the plugin constructs the `jf c add` command and passes user, password, and URL settings to the JFrog CLI. Check how the `--enc-password=false` and `--basic-auth-only` options could be represented in the plugin configuration, then verify that an access-token pipeline can complete `jf rt ping` without a 401 response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100