Reputation: 309
I would like to install some composer dependencies in my project. We host these dependencies in a local Gitlab repository. According to the composer doc, I have two options to verify Composer for Gitlab:
Creating the Gitlab token is pretty easy and it works with HTTP repositories but the problem is that the project is configured to use ssh instead of Http request and for some internal reason my colleagues don't want to change it.
So I have the oauth key but I don't know how to create the OAuth token in gitlab. I try to create in user -> settings -> Access Token but I think that this is not the OAuth token.
Then I also try to create user -> settings -> Application and create an application token an use it in composer but it also doesn't work.
The only way that I found is executing composer without any config fill my user/pass and then check the token in auth.json created by Composer but this is a really ugly way to do it.
Could someone shed some light here?
Upvotes: 1
Views: 2067
Reputation: 2240
According to https://github.com/composer/composer/blame/0fe200d6d950b0774688713be3153bb410eb70b8/src/Composer/Util/GitLab.php#L166 it should be
https://<yourgitlab.domain>/oauth/token
. But you need to send a POST request with the following data: https://docs.gitlab.com/ee/api/oauth2.html#resource-owner-password-credentials-flow
Upvotes: 1