Hi Christophe,
On 09/12/2016 03:35 PM, Christophe Pettus wrote:
> I've encountered a service that does postbacks as part of its API.
> The only authentication mechanism is putting the username and
> password in the POST URL in the form:
>
>
https://user:pa...@example.com/api/endpoint
>
> Is there a portable way of extracting that information from the
> request object?
Yes, it should be in `request.META['HTTP_AUTHORIZATION']`; see
https://www.djangosnippets.org/snippets/243/ for an example.
The user:pass@host URL syntax is just a way of expressing credentials
for HTTP Basic Authentication; the values should end up in the
Authorization header.
Carl