1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Merge pull request #7201 from aniruddha2000/basic_cred

Describe basic auth credentials in documentation
This commit is contained in:
Christopher Hunt 2019-11-13 10:52:50 +08:00 committed by GitHub
commit 4c1a7cda5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View file

@ -49,6 +49,35 @@ For more information and examples, see the :ref:`pip install` reference.
.. _PyPI: https://pypi.org/
Basic Authentication Credentials
********************************
pip supports basic authentication credentials. Basically, in the url there is
a username and password separated by ``:``.
``https://[username[:password]@]pypi.company.com/simple``
Certain special characters are not valid in the authentication part of URLs.
If the user or password part of your login credentials contain any of the
special characters
`here <https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters>`_
then they must be percent-encoded. For example, for a
user with username "user" and password "he//o" accessing a repository at
pypi.company.com, the index URL with credentials would look like:
``https://user:he%2F%2Fo@pypi.company.com``
Support for percent-encoded authentication in index URLs was added in pip 10.0.0
(in `#3236 <https://github.com/pypa/pip/issues/3236>`_). Users that must use authentication
for their Python repository on systems with older pip versions should make the latest
get-pip.py available in their environment to bootstrap pip to a recent-enough version.
For indexes that only require single-part authentication tokens, provide the token
as the "username" and do not provide a password, for example -
``https://0123456789abcdef@pypi.company.com``
Using a Proxy Server
********************

1
news/7201.doc Normal file
View file

@ -0,0 +1 @@
Describe how basic authentication credentials in URLs work.