Clarification Needed on Token for GitLab Trigger Pipeline

MasakiO
Tera Contributor

I would like to use a trigger pipeline with GitLab.
(note that we do not have a contract for Integration Hub)

The OAuth2 authentication setup (application registration) has already been completed.

 

I plan to make a POST request using the information from the following site:
https://docs.gitlab.com/ci/triggers/

 

In this documentation, it mentions "token=<token>".

Could you please clarify which "token" should be specified here?

7 REPLIES 7

Thanks for the comment.
The current configuration is as follows

Application Registries
->Configured the application id and secret created in GitLab.

OAuth Entry Profile
->Configuration is complete.

REST Message
->Endpoint=https://gitlab.com/api/v4/projects/“ProjectID”/ has been set.
Endpoint=“https://gitlab.com/api/v4/projects/${PROJECT_ID}/trigger/pipeline?token=${TRIGGER_TOKEN}&ref=${TAG}” as HTTP Methods. Already set.

“TAG” is a fixed value, so there is no problem.” TRIGGER_TOKEN” is a variable value that is generated and specified each time. I am having trouble understanding how to set this value.

Do you know how to set TRIGGER_TOKEN to a key generated on the ServiceNow side?

Hello @masaki_ogawa ,

I am using the below curl example

 

curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipelines?ref=${ref}"

 


Reference: https://docs.gitlab.com/api/pipelines/

PRIVATE-TOKEN is the value given by the Gitlab team, which you will store it in the HTTP Headers of the Rest Message.

1 is the project_id
${ref} is similar to your ${TAG}

We do not generate any Key in the ServiceNow. We use the PRIVATE TOKEN itself as the key.

If the above information helps you, kindly mark it as Helpful and Accept the solution.

Regards,
Najmuddin.

masaki_ogawa
Tera Expert

Thanks for the comment!
However, the information was not using PKCE or trigger tokens.