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

Describe basic auth credentials in documentation #7201

Merged
merged 13 commits into from
Nov 13, 2019
29 changes: 29 additions & 0 deletions docs/html/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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%[email protected]``

Support for percent-encoded authentication in index URLs was added in pip 10.0.0
(in `#3236 <https:/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://[email protected]``


Using a Proxy Server
********************

Expand Down
1 change: 1 addition & 0 deletions news/7201.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Describe how basic authentication credentials in URLs work.