-
First of all thanks for the spring-addons! While trying to switch from Spring Boot 2.x to 3.x and getting rid of the Keycloak adapters, I found this repo. Most things seem to be working, one issue I have is with configuring CORS. Thanks a lot in advance and keep up the great work! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There are properties to define allowed origins, headers and methods, as well as exposed headers, per path matcher:
Sample usage in the BFF tutorial. Please note that this configuration is not necessary when accessing both the API and the Angular app through the gateway, in which case all requests share the same origin, but providing such configuration enables direct access to the API (or access through the gateway from a client which is served aside of it). If you need more flexibility, please open a ticket to expose how and why (use case), or just expose a security "post-processor" bean to override CORS configuration (for instance, Edit@gholcleo maybe I had misunderstood your question and what you wanted is what was introduced with |
Beta Was this translation helpful? Give feedback.
There are properties to define allowed origins, headers and methods, as well as exposed headers, per path matcher:
com.c4-soft.springaddons.security.cors
for OAuth2 resource serverscom.c4-soft.springaddons.security.client.cors
for OAuth2 clientsSample usage in the BFF tutorial. Please note that this configuration is not necessary when accessing both the API and the Angular app through the gateway, in which case all requests share the same origin, but providing such configuration enables direct access to the API (or access through the gateway from a client which is served aside of it).
If you need more flexibility, please open a ticket to expose how and why (use case), or just expose a…