Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpOnly not working #1

Open
naviinbharathy opened this issue Mar 29, 2024 · 1 comment
Open

HttpOnly not working #1

naviinbharathy opened this issue Mar 29, 2024 · 1 comment

Comments

@naviinbharathy
Copy link

I have followed your spring boot 3 and angular 17 JWT tutorial. Everything is working fine except JWT.

  1. I am able login, and refresh token is created
  2. I am able to see httpOnly cookie in my frontend response
  3. but for subsequent requests token is not being sent to backend
  4. backend it shows "AnonymousUser"
@tienbku
Copy link
Contributor

tienbku commented Mar 29, 2024

Hi, before running the backend server, you need to add minor configuration:

/* In AuthController.java */
// @CrossOrigin(origins = "*", maxAge = 3600)
@CrossOrigin(origins = "http://localhost:8081", maxAge = 3600, allowCredentials="true")

/* In TestController.java */
// @CrossOrigin(origins = "*", maxAge = 3600)
@CrossOrigin(origins = "http://localhost:8081", maxAge = 3600, allowCredentials="true")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants