mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 18:21:03 -03:30
Merge pull request #479 from chrismeyersfsu/fix-basic_auth_cookies
if basic auth in headers, don't use cookie token
This commit is contained in:
@@ -50,7 +50,10 @@ class TokenAuthentication(authentication.TokenAuthentication):
|
|||||||
auth = TokenAuthentication._get_x_auth_token_header(request).split()
|
auth = TokenAuthentication._get_x_auth_token_header(request).split()
|
||||||
if not auth or auth[0].lower() != 'token':
|
if not auth or auth[0].lower() != 'token':
|
||||||
auth = authentication.get_authorization_header(request).split()
|
auth = authentication.get_authorization_header(request).split()
|
||||||
if not auth or auth[0].lower() != 'token':
|
# Prefer basic auth over cookie token
|
||||||
|
if auth and auth[0].lower() == 'basic':
|
||||||
|
return None
|
||||||
|
elif not auth or auth[0].lower() != 'token':
|
||||||
auth = TokenAuthentication._get_auth_token_cookie(request).split()
|
auth = TokenAuthentication._get_auth_token_cookie(request).split()
|
||||||
if not auth or auth[0].lower() != 'token':
|
if not auth or auth[0].lower() != 'token':
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user