Open fiorillj opened 1 year ago
@fiorillj,
Thanks for reporting this issue.
This issue is only relevant for reference tokens (64 characters tokens). Also could it be that your Artifactory URL doesn't end with /artifactory
?
/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
The 401 error for reference tokens is already resolved in Artifactory >= 7.42.0. What is your Artifactory version?
Our version is Enterprise Plus 7.41.12 rev 74112900. We are using an account and password as a workaround for now.
Looks like we need to upgrade to use tokens with the plugin.
Thanks, John
From: Yahav Itzhak @. Sent: Saturday, March 18, 2023 12:23 PM To: jenkinsci/jfrog-plugin @.> Cc: Fiorillo, John @.>; Mention @.> Subject: Re: [jenkinsci/jfrog-plugin] jfrog plugin using access token not working (Issue #12)
@fiorilljhttps://github.com/fiorillj, Thanks for reporting this issue. This issue is only relevant for reference tokens (64 characters tokens). Also could it be that your Artifactory URL doesn't end with /artifactory?
/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
The 401 error for reference tokens is already resolved in Artifactory >= 7.42.0. What is your Artifactory version?
— Reply to this email directly, view it on GitHubhttps://github.com/jenkinsci/jfrog-plugin/issues/12#issuecomment-1474898645, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKGFI3UMOGA3BRVTSKTUTGLW4XONJANCNFSM6AAAAAAUQQET5E. You are receiving this because you were mentioned.Message ID: @.**@.>>
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.