You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version 0.40.0 introduced a regression in CORS handling by the decisions API. Up to v0.39.4 it worked flawlessly, now it's broken.
The regression was introduced by #999 - this line to be exact. It adds the CORS handler after the DecisionHandler.
After this change the CORS preflight requests (OPTIONS) are intercepted and authenticated by the DecisionHandler which always fail, because browsers don't attach the authentication data to the preflight requests.
Reproducing the bug
Run Oathkeeper with the API configuration as attached below
Make Oathkeeper decisions API available under localhost:4456
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Site
Access-Control-Allow-Methods: GET
Access-Control-Allow-Origin: http://localhost:5000
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Date: Tue, 24 Jan 2023 14:13:33 GMT
Content-Length: 0
Actual response (copied from v0.40.1):
HTTP/1.1 401 Unauthorized
Content-Type: application/json
Date: Tue, 24 Jan 2023 14:16:16 GMT
Content-Length: 95
{"error":{"code":401,"status":"Unauthorized","message":"The request could not be authorized"}}
Preflight checklist
Describe the bug
Version 0.40.0 introduced a regression in CORS handling by the decisions API. Up to v0.39.4 it worked flawlessly, now it's broken.
The regression was introduced by #999 - this line to be exact. It adds the CORS handler after the
DecisionHandler
.After this change the CORS preflight requests (
OPTIONS
) are intercepted and authenticated by theDecisionHandler
which always fail, because browsers don't attach the authentication data to the preflight requests.Reproducing the bug
localhost:4456
Expected response (copied from v0.39.4):
Actual response (copied from v0.40.1):
Relevant log output
No response
Relevant configuration
Version
0.40.1
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Kubernetes with Helm
Additional Context
No response
The text was updated successfully, but these errors were encountered: