Backend tweaks to make authorization work (#14339)
* Backend tweaks to make authorization work * Lint * Add test * Validate redirect uris * Fix tests * Fix tests * Lint
This commit is contained in:
parent
0f3ec94fba
commit
5ec7fc7ddb
17 changed files with 176 additions and 58 deletions
|
@ -81,7 +81,12 @@ async def async_validate_auth_header(api_password, request):
|
|||
if hdrs.AUTHORIZATION not in request.headers:
|
||||
return False
|
||||
|
||||
auth_type, auth_val = request.headers.get(hdrs.AUTHORIZATION).split(' ', 1)
|
||||
try:
|
||||
auth_type, auth_val = \
|
||||
request.headers.get(hdrs.AUTHORIZATION).split(' ', 1)
|
||||
except ValueError:
|
||||
# If no space in authorization header
|
||||
return False
|
||||
|
||||
if auth_type == 'Basic':
|
||||
decoded = base64.b64decode(auth_val).decode('utf-8')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue