I'm building restful app basing on react library. I want to give app users access to a few Jenkins jobs, but i found a problem.
I have to somehow auth users. App auth is not enough, what i mean is that people who start jobs through my app, they also should have account in the Jenkins. App is just the way to make it simpler and faster. Can i somehow require from the users Jenkins username and password? I don't want to share with everyone my api token.
Use Case
- User login to my panel
- User access subpage with Jenkins
- App asks for Jenkins login and password
- I send request to the Jenkins
- If both are fine, then it sends back api token
Or if i can require from user to attach login and password to the request, each time user tries to get list of jobs or start/delete/edit job, something like:
curl -X POST JENKINS_URL/job/JOB_NAME/build \
--user USER:PASSWORD \
--data-urlencode json='{"parameter": [{"name":"id", "value":"123"}, {"name":"verbosity", "value":"high"}]}'
Most important for me is to avoid hardcoding api token in the app.