Answers: <p>Thank you to the comment from user54 for the answer.</p>
  
  <p>Both of my pasted <code>wget</code> 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:
  <a href="https://stackoverflow.com/a/34634247/317951">https://stackoverflow.com/a/34634247/317951</a></p>
  
Answers: CC BY-SA 3.0
Answers: 2017-10-16T22:42:30.690Z
Answers: 2017-10-16T22:42:30.690Z
Answers: Jeff Fairley
Body: <p>I recently spun up a new Jenkins instance and installed the <a href="https://wiki.jenkins.io/display/JENKINS/Google+Login+Plugin" rel="nofollow noreferrer">Google Login Plugin</a> 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.</p>
  
  <p>I tried the following <code>wget</code> command without success.</p>
  
  <pre><code>wget --auth-no-challenge --http-user=XXXX --http-password=XXXX https://____/job/_____/lastSuccessfulBuild/artifact/target/ROOT.war
  </code></pre>
  
  <p>I also tried the same without <code>http-</code>:</p>
  
  <pre><code>wget --auth-no-challenge --user=XXXX --password=XXXX https://____/job/_____/lastSuccessfulBuild/artifact/target/ROOT.war
  </code></pre>
  
  <p>The response is always</p>
  
  <pre><code>401 Invalid password/token for user: XXXX
  </code></pre>
  
  <p>I attempted to follow <a href="https://stackoverflow.com/questions/18244110/use-bash-curl-with-oauth-to-return-google-apps-user-account-data/18260206#18260206">this post</a> but ran into an issue.</p>
  
  <p>I have seen <a href="http://blog.backslasher.net/downloading-artifacts-from-jenkins-with-authentication.html" rel="nofollow noreferrer">this workaround</a>, but it seems like I'd be adding a security hole.</p>
  
  <p>Does anyone have experience with this plugin or in general just downloading from an OAuth-protected endpoint?</p>
  
Comments: CC BY-SA 3.0
Comments: 2017-10-13T22:10:06.077Z
Comments: Please try the described method in this post: https://stackoverflow.com/questions/34632796/jenkins-trigger-a-job-from-api
Comments: user54
Tags: <jenkins><continuous-integration><google-cloud-platform>
Title: How can I download an artifact from Jenkins using the Google Login Plugin?
UserDisplayName: Jeff Fairley
ThreadText: # How can I download an artifact from Jenkins using the Google Login Plugin?
  
  (Asked by: username_0 on 2017-10-13)
  
  I recently spun up a new Jenkins instance and installed the [Google Login Plugin](https://wiki.jenkins.io/display/JENKINS/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](https://stackoverflow.com/questions/18244110/use-bash-curl-with-oauth-to-return-google-apps-user-account-data/18260206#18260206) but ran into an issue.
  
  I have seen [this workaround](http://blog.backslasher.net/downloading-artifacts-from-jenkins-with-authentication.html), 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?
  
  **Tags:** jenkins, continuous-integration, google-cloud-platform
  
  > **Comments:**
  > **username_1**: Please try the described method in this post: https://stackoverflow.com/questions/34632796/jenkins-trigger-a-job-from-api  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-10-16. Score: 2 | Accepted answer
  
  Thank you to the comment from username_1 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>
  
  
  ---
  
  