1

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?

1

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. There is also a question about API tokens posted to StackOverflow.

0

I would recommend using the Generic Webhook Trigger... it will allow you to specify a unique token per job and will trigger from a webhook.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.