Micronaut CORS configuration does not expose the specified header(s)
See original GitHub issueExpected Behavior
When exposing the Location
header via the CORS configuration in application.yml
, I expect the header to be accessible in front-end scripts.
Actual Behaviour
When exposing the Location
header via the CORS configuration in application.yml
, the header is NOT accessible in front-end scripts.
Steps To Reproduce
- Clone the repository
- Start up a Keycloak authentication server with the given
realm-export.json
file - Start up the Micronaut application
- Open the given
index.html
file in your browser - See that the
Location
header is NOT logged to the console - If you change the version to 3.7.2 and update
micronaut-security-jwt
andmicronaut-security-oauth2
to use 3.8.0, I can see theLocation
header
Environment Information
- Operating System: macOS Ventura 13.0
- JDK (I assume this issue would still occur with JDK 17): openjdk 20-ea 2023-03-21 OpenJDK Runtime Environment (build 20-ea+21-1545) OpenJDK 64-Bit Server VM (build 20-ea+21-1545, mixed mode, sharing)
Example Application
https://github.com/lbkulinski/micronaut-3.7.3-regression
Version
3.7.3
Issue Analytics
- State:
- Created a year ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
micronaut-core/cors.adoc at 4.0.x - GitHub
Exposed Headers. To configure the headers that are sent in the response to a CORS request through the Access-Control-Expose-Headers header ...
Read more >Micronaut Framework/questions - Gitter
Two questions: 1) Is there a better way to do this? 2) I need it to happen before each route. Ive tried @Options("/**")...
Read more >CORS in Micronaut Microservice - java - Stack Overflow
You want configure the CORS to allow requests from your front end. Is this issue exclusive to a React/Web pages? Would I need...
Read more >Configuration Reference | Micronaut
Sets the name of the cookie that is used to store the locale. micronaut.server.locale-resolution.header. boolean. Set to true if the locale should be ......
Read more >Configuration Reference | Micronaut
Sets the name of the cookie that is used to store the locale. micronaut.server.locale-resolution.header. boolean. Set to true if the locale should be ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@lbkulinski 3.8.2 fixes this https://github.com/micronaut-projects/micronaut-security/releases/tag/v3.8.2
@yawkat
You can then access the admin console by going to http://localhost:8543/admin/master/console/#/. For some reason I have to reload that page to get the login screen. The username and password are those mentioned in the command. From there, you can create a new realm with the given configuration.