I am trying to configure a secured Jenkins server in a company network where GitLab CE is already running. I have set the access control and the authorization system in Jenkins via the GitLab Authentication Plugin and a trusted application in Jenkins with admin rights and API and read_repo scopes.
The authentication is working great, and users are automatically logged into Jenkins with their GitLab's username as soon as they get into the Jenkins server portal.
However, I have found some trouble to set the GitLab connection that should enable pulling from GitLab and reporting build status back to GitLab for everybody without the need of defining individual credentials or API tokens. In other words, I'd like to avoid using users or admins credentials, personal API tokens or deploy keys/tokens.
I understand that considering that my admin application in GitLab has API and read_repository scopes, I should be able to do so with the client id and secret I have, but I cannot find the way to make it work.
My questions are:
- Do I need any additional scope on top of API and read_repository in my application in GitLab?
- In Jenkins, the GitLab connections option under Configure System asks me for an API token. What should I configure there if I don't have/want to use an admin personal API token? I understand the GitLab application should be able to generate (dynamically?) an API token for every logged user or impersonate him somehow via this authentication process.