mirror of
https://github.com/ansible/awx.git
synced 2026-03-23 11:55:04 -02:30
AC-654 Add API support for token auth using X-Auth-Token header in addition to AUthorization header, fixes issue where API requests from the UI are picking up the basic auth from an API session.
This commit is contained in:
@@ -85,7 +85,12 @@ class APIView(views.APIView):
|
||||
continue
|
||||
if resp_hdr.split()[0] and resp_hdr.split()[0] == req_hdr.split()[0]:
|
||||
return resp_hdr
|
||||
return super(APIView, self).get_authenticate_header(request)
|
||||
# If it can't be determined from the request, use the last
|
||||
# authenticator (should be Basic).
|
||||
try:
|
||||
return authenticator.authenticate_header(request)
|
||||
except NameError:
|
||||
pass
|
||||
|
||||
def get_description_context(self):
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user