-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make redirect URL auth take precedence over input auth in client
- Loading branch information
Pierre-Louis Peeters
committed
Oct 18, 2024
1 parent
9e10136
commit fcf5292
Showing
4 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Authentication provided by a redirect now takes precedence over provided ``auth`` when making requests with the client -- by :user:`PLPeeters`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,13 @@ argument. An instance of :class:`BasicAuth` can be passed in like this:: | |
async with ClientSession(auth=auth) as session: | ||
... | ||
|
||
Note that if the request is redirected and the redirect URL contains | ||
credentials, those credentials will supersede any previously set credentials. | ||
In other words, if ``http://[email protected]`` redirects to | ||
``http://[email protected]``, the second request will be authenticated | ||
as ``other_user``. Providing both the ``auth`` parameter and authentication in | ||
the *initial* URL will result in a :exc:`ValueError`. | ||
|
||
For other authentication flows, the ``Authorization`` header can be set | ||
directly:: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters