I have a small pipeline to use a custom composer package into a project:
Invalid credentials for 'https://gitlab.com/users/sign_in', aborting.
I added an entry in the repositories
section of composer.json and added gitlab credentals with composer cli command
composer.json
'repositories' entry"repositories": [
{
"type": "composer",
"url": "https://gitlab.com/vendor/group/project"
}
]
composer config gitlab-token.gitlab.com glpat-123456789abcdefgh
auth.json
generated by composer cli{
"gitlab-token": {
"gitlab.com": "glpat-123456789abcdefgh"
}
}
composer require
Invalid credentials for 'https://gitlab.com/users/sign_in', aborting.
Ok, i did found a wrong documentation page.
According to Install a Composer package the correct composer cli command to add the repository entry in composer.json
is
composer config repositories.<group_id> composer https://gitlab.example.com/api/v4/group/<group_id>/-/packages/composer/
that leads to the entry
"repositories": {
"<group_id>": {
"type": "composer",
"url": "https://gitlab.example.com/api/v4/group/<group_id>/-/packages/composer/"
},
...
},