question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Micronaut CORS configuration does not expose the specified header(s)

See original GitHub issue

Expected 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

  1. Clone the repository
  2. Start up a Keycloak authentication server with the given realm-export.json file
  3. Start up the Micronaut application
  4. Open the given index.html file in your browser
  5. See that the Location header is NOT logged to the console
  6. If you change the version to 3.7.2 and update micronaut-security-jwt and micronaut-security-oauth2 to use 3.8.0, I can see the Location 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:closed
  • Created a year ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
lbkulinskicommented, Nov 7, 2022

@yawkat

docker run -d -p 8543:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=password quay.io/keycloak/keycloak:19.0.2 start-dev

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found