Try to get WWW-Authenticate header from all authentication classes instead of only the first one (fixes #4680)

This commit is contained in:
Leonardo Arroyo 2016-11-14 18:32:43 -02:00
parent 45e90c3398
commit 6a8116af1a

View File

@ -182,7 +182,11 @@ class APIView(View):
"""
authenticators = self.get_authenticators()
if authenticators:
return authenticators[0].authenticate_header(request)
for authenticator in authenticators:
authenticate_header = authenticator.authenticate_header(request)
if authenticate_header:
return authenticate_header
return None
def get_parser_context(self, http_request):
"""