I am trying to use an API token(For the first time) to clone the code from our self-hosted GitLab server. However, I could not find the API token after I created it.
It is most likely is that the credential type that you created is not the credential type that is expected in that context.
The git plugin accepts username / password credentials for HTTP and HTTPS repository access and it accepts SSH private key credentials for SSH repository access. It does not accept any other credential types. It does not accept a GitLab API token credential.
Ah! This looks like the same problem with the repositories of my students. The user experience is very poor in this case, I think we should rethink the UI here.
The user selects “create credentials”, the user creates a new “token”, the dialog closes, but nothing to see, even no error message that the newly created token is not valid.
When an access token is created in the Gitlab group, a Jenkins-bot user is automatically created. But this user cannot log in.
So, if the git plugin only accepts username/password credential type, did you set the password to the jenkins-bot user or create a new user such as jenkins-puller to let Jenkins clone repository from Gitlab?