<p>Typically you authenticate API calls (I assume you mean HTTP REST API; there is also a Groovy API) using an API token.  The API token can be generated from a user's profile page while logged in as that user (Profile page > Configure > API Token).  More information about generating and using API tokens is <a href="https://wiki.jenkins.io/display/JENKINS/Authenticating+scripted+clients" rel="nofollow noreferrer">available in the official documentation</a>.  There is also <a href="https://stackoverflow.com/questions/45466090/how-to-get-the-api-token-for-jenkins">a question about API tokens posted to StackOverflow</a>.</p>

CC BY-SA 4.0
2018-11-15T20:09:21.657Z
2018-11-15T20:09:21.657Z
jayhendren
<p>I would recommend using the <a href="https://plugins.jenkins.io/generic-webhook-trigger" rel="nofollow noreferrer">Generic Webhook Trigger</a>... it will allow you to specify a unique token per job and will trigger from a webhook. </p>

CC BY-SA 4.0
2018-11-15T03:57:39.030Z
2018-11-15T03:57:39.030Z
primetheus
<p>Jenkins API calls are generally made using a username/password combination, or other set of credentials. </p>

<p>We have a Jenkins instance using "Log in with Google" authentication, meaning no credentials are stored in Jenkins for users since login happens with OAuth. I can neither make a new user with creds of my choice, nor view my own credentials to use for the call. </p>

<p>I intend to build jobs using the API, so setting the Anonymous roll to be allowed to build isn't an option. If it matters, my goal is to trigger jobs via an AWS Lambda.</p>

<p>How do I get credentials to use for API calls?</p>

CC BY-SA 4.0
2018-11-14T09:03:39.573Z
sounds like a job for a plugin. There is one for the "opposite" problem : turning authentication tokens to user name and password -- https://plugins.jenkins.io/authentication-tokens From reading the [Jenkins documentation](https://wiki.jenkins.io/display/JENKINS/Authenticating+scripted+clients) it seems like this is not mainstream, if it works at all.
Bruce Becker
<jenkins><api>
How to make a Jenkins API call when using "Log in with Google" as security?
Alex
# How to make a Jenkins API call when using "Log in with Google" as security?

(Asked by: username_0 on 2018-11-13)

Jenkins API calls are generally made using a username/password combination, or other set of credentials.

We have a Jenkins instance using "Log in with Google" authentication, meaning no credentials are stored in Jenkins for users since login happens with OAuth. I can neither make a new user with creds of my choice, nor view my own credentials to use for the call.

I intend to build jobs using the API, so setting the Anonymous roll to be allowed to build isn't an option. If it matters, my goal is to trigger jobs via an AWS Lambda.

How do I get credentials to use for API calls?

**Tags:** jenkins, api

> **Comments:**
> **username_1**: sounds like a job for a plugin. There is one for the "opposite" problem : turning authentication tokens to user name and password -- https://plugins.jenkins.io/authentication-tokens From reading the [Jenkins documentation](https://wiki.jenkins.io/display/JENKINS/Authenticating+scripted+clients) it seems like this is not mainstream, if it works at all.  

---

## 2 answers

### Answer by username_2 on 2018-11-15. Score: 2 | Accepted answer

Typically you authenticate API calls (I assume you mean HTTP REST API; there is also a Groovy API) using an API token. The API token can be generated from a user's profile page while logged in as that user (Profile page > Configure > API Token). More information about generating and using API tokens is [available in the official documentation](https://wiki.jenkins.io/display/JENKINS/Authenticating+scripted+clients). There is also [a question about API tokens posted to StackOverflow](https://stackoverflow.com/questions/45466090/how-to-get-the-api-token-for-jenkins).


---

### Answer by username_3 on 2018-11-15. Score: 0

I would recommend using the [Generic Webhook Trigger](https://plugins.jenkins.io/generic-webhook-trigger)... it will allow you to specify a unique token per job and will trigger from a webhook.


---

