3

I recently spun up a new Jenkins instance and installed the Google Login Plugin for authentication via Google. I would like to download build artifacts to servers using a shell script, basically curl or wget, but cannot authenticate properly from command line.

I tried the following wget command without success.

wget --auth-no-challenge --http-user=XXXX --http-password=XXXX https://____/job/_____/lastSuccessfulBuild/artifact/target/ROOT.war

I also tried the same without http-:

wget --auth-no-challenge --user=XXXX --password=XXXX https://____/job/_____/lastSuccessfulBuild/artifact/target/ROOT.war

The response is always

401 Invalid password/token for user: XXXX

I attempted to follow this post but ran into an issue.

I have seen this workaround, but it seems like I'd be adding a security hole.

Does anyone have experience with this plugin or in general just downloading from an OAuth-protected endpoint?

Jeff Fairley
  • 151
  • 1
  • 5
  • 1
    Please try the described method in this post: https://stackoverflow.com/questions/34632796/jenkins-trigger-a-job-from-api – user54 Oct 13 '17 at 22:10

1 Answers1

2

Thank you to the comment from user54 for the answer.

Both of my pasted wget URLs work as long as I'm using the correct value for password. In this case, I needed to use my user's API Token as described in the answer to another question: https://stackoverflow.com/a/34634247/317951

Jeff Fairley
  • 151
  • 1
  • 5