Skip to content
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

Auth via Manual Inline Basic Http is Misleading #241

Open
ralphschindler opened this issue Dec 23, 2024 · 2 comments
Open

Auth via Manual Inline Basic Http is Misleading #241

ralphschindler opened this issue Dec 23, 2024 · 2 comments

Comments

@ralphschindler
Copy link

On: https://getcomposer.org/doc/articles/authentication-for-private-packages.md#manual-inline-http-basic

The suggestion to use username:password does not work when composer install is initially run via a non-interactive console.

Moving the credentials to the composer.json's config.http-basic.<domain>.{username,password} keys fixes the issue, but is non-obvious and should be called out as the preferred solution for those who wish to have credentials in their composer.json. If you have direction for the suggested fix in documentation, I can attempt to create a PR.

@Seldaek
Copy link
Member

Seldaek commented Feb 3, 2025

I'm not sure, I feel like it's a bug if this doesn't work, but I'd have to try and check why it's not working..

@Seldaek
Copy link
Member

Seldaek commented Feb 3, 2025

So I cannot repro this..

{
    "repositories": [
        {
            "type": "composer",
            "url": "https://MY_USER:[email protected]/test-repo/"
        }
    ], 
    "require": {
        "foo/bar": "*"
    }
}

Running composer update -vvv --no-interaction I get this:

[...]
Using HTTP basic authentication with username "MY_USER"
Downloading https://MY_USER:***@repo.packagist.com/test-repo/packages.json
[200] https://MY_USER:***@repo.packagist.com/test-repo/packages.json

So it seems to work fine despite not being too advisable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants