File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,6 +94,12 @@ async def validate_token(
9494 try :
9595 # Validate using auth URL if provided; will error if invalid
9696 if auth_url :
97+ # Extract and forward headers as-is
98+ headers = dict (request .headers )
99+ # Update/add authorization header if authenticating using password
100+ if security_config .auth_type == "password" :
101+ headers ["authorization" ] = f"Bearer { token } "
102+ # Forward the cookie along if authenticating using cookie
97103 cookies = (
98104 {security_config .cookie_key : token }
99105 if security_config .auth_type == "cookie"
@@ -102,7 +108,7 @@ async def validate_token(
102108 async with aiohttp .ClientSession (cookies = cookies ) as session :
103109 async with session .get (
104110 f"{ auth_url } /validate_token" ,
105- headers = request . headers ,
111+ headers = headers ,
106112 ) as response :
107113 success = response .status == 200
108114 validation_outcome = await response .json ()
You can’t perform that action at this time.
0 commit comments