Hi,
I'm truggling a bit with CORS.
There is basically three places where I can but CORS headers
1. Application as CORS Filter
2. Wildfly config filter/header config
3. Keycloak adapter config.
I first tested adding headers to wildly filters. -> Firefox works after few requests, Safari and Chrome Don't
Then I removed wildfly filter config and added CORS filter to application -> Same results
Then I removed app CORS filter and added wildfly filters + Keycloak adapter CORS config. -> Nothing worked since double CORS headers
Then app CORS filter and Keycloak adapter CORS configs. -> Firefox is working others not.
Last config feels correct but doesn't work. When checking Chrome console, it says 404 preflight OPTIONS request
When I test with curl
HTTP/1.1 200 OK
Access-Control-Allow-Headers: origin, content-type, accept, authorization
Date: Thu, 11 Feb 2021 17:24:07 GMT
Allow: HEAD, GET, OPTIONS
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Content-Type: text/plain;charset=UTF-8
Content-Length: 18
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, HEAD
Access-Control-Max-Age: 1209600
Set-Cookie: 8ab0e4839bad454683c8a580e07b486f=4723ea45ba902fb510af0be55984f04f; path=/; HttpOnly; Secure
Cache-control: private
So address is correct. So I'm wondering where request is lost. Application doesn't receive, since application log is empty, I have logging in CORS filter.
There is not evidence in Wildfly servers logs with DEBUG level.
Kind of hard to figure out what is going on. Can OpenShift HaProxy router break everything.....funny part is that everything has been working like 3 days ago.