-
Notifications
You must be signed in to change notification settings - Fork 3.1k
pip no longer prompts for user credentials #10016
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
Comments
Please take this up with Artifactory folks -- providing a 401 will result in better behaviour from newer/future versions of pip (IIRC, it has a clearer error message).
Well, what a fun edge case. :) While there's been a unintended change in behaviour here, I'm not sure that the older behaviour was correct even. Given that in about two months, we've seen exactly one instance of this being reported, I'm inclined to say that it's unlikely that we'd be rolling back the change. Could you clarify why this change in behaviour is problematic and should be considered an issue? |
I wouldn’t even say it’s unintended. This is similar to the |
At the moment, there is no way we can get a user prompt, not even if we send the user name and blank password or no password at all. Keyrings are not an option for us since we run the pip installation in different environments where no keyring might be present. We do not want to have user credentials in the terminal history, which is why we are using env vars. These env vars are only allowed to be set in certain environments; whenever they are not set, we rely on the prompt. I'll check to see if there is anything we can do on the artifactory side, but if not, it would be great if you could take this up. |
There was also a similar situation with Google Artifact Registry (they returned 403) and a user was successful asking them to change it to 401. This could be useful information for Artifactory. Please do also post an update here when you reach out toe Arfitactory so we can also join the discussion there if needed. (Edit: forgot the link the Artifact Registry issue #9870) |
Could you link that issue here? |
After some more investigation, I found out that artifactory does indeed return 404 for empty credentials, which we might be able to change to 401 on our side by changing the configuration (still to be investigated). However, when sending a username and no/empty password, artifactory returns 401 but pip still does not prompt for user credentials. This makes pip >= 21.1 unusable for us and we are stuck with the older version. I can provide more insights if needed, just let me know. |
This thread: #9974 (comment) |
Just to follow up, would you consider investigating the failure to prompt in case of 401 for |
I think it’s correct to not prompt. You supplied a username/password pair with |
Description
When installing from an index url containing environment variables for user authentication, pip no longer prompts for credentials in case the environment variables aren't set. This used to work up until v20.3.4.
Note: In our particular use case, packages are located on artifactory which returns 404 rather than 401 in case of incorrect credentials. Keyring is not an option since this needs to work in different environments where no keyring might be available.
Expected behavior
If environment variables needed for user authentication aren't set, pip should prompt for credentials.
pip version
21.1.1
Python version
3.6.9
OS
Ubuntu 18.04 LTS
How to Reproduce
This works for pip version <= 20.3.4:
Instead now I get this:
Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: