-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GitLab authentication issue over HTTPS #11062
Comments
I am not sure anymore why we swap these tbh.. but I am fairly sure it did work as is. Not sure if it's a new GitLab change causing issues or if you're misconfiguring it. I'm assuming you've read https://getcomposer.org/doc/articles/authentication-for-private-packages.md#gitlab-oauth ? |
Yes, I followed the instructions on that page :( I am not sure it is a recent change, I have tested on both gitlab 13 (quite old) and the latest gitlab 15 Note that using |
Ok well I am not sure maybe someone more familiar with GitLab can help here.. |
I think I have found the isssue - it is a misconfiguration on my side there is a note I missed in the documentation
Setting that config seems to work - sorry for the confusion! |
…resent for custom domains, fixes #11062
OK, no worries. As per @glaubinix's suggestion in 2.5+ Composer will auto-configure gitlab-domains/github-domains if auth is present, that would prevent any such mistake from occurring. See 22bedfd |
…resent for custom domains, fixes composer#11062 Add "--dry-run" to bump command (composer#11047)
…resent for custom domains, fixes composer#11062
I have setup composer (v2.4.2) to access a repo from my test gitlab instance over https:
and configured the authentication with:
composer config --global gitlab-oauth.gitlab.example.com <<TOKEN>>
(where
<<TOKEN>>
is generated in GitLab withread_repository
scope)However
composer install
fails with:Failed to execute git clone --mirror -- 'https://xxx...xxx:oauth2@gitlab.example.com/myproject.git
It looks like composer swaps username and token, possibly here:
composer/src/Composer/Util/GitLab.php
Line 69 in 7ff288f
composer/src/Composer/Util/GitLab.php
Line 161 in 7ff288f
composer/src/Composer/Util/GitLab.php
Line 204 in 7ff288f
Although there is a relevant note here:
composer/src/Composer/Util/GitLab.php
Line 96 in 7ff288f
Manually issuing
git clone --mirror -- 'https://oauth2:<<TOKEN>>@gitlab.example.com/myproject.git
(ie swapping username and token) works.I also tried
composer config --global gitlab-token.gitlab.example.com <<TOKEN>>
with similar results:Failed to execute git clone --mirror -- 'https://xxx...xxx:private-token@gitlab.example.com/myproject.git'
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: