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

JWT Cookie #4

Open
matteioo opened this issue Feb 22, 2024 · 5 comments
Open

JWT Cookie #4

matteioo opened this issue Feb 22, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request prio:LOW

Comments

@matteioo
Copy link
Collaborator

The backend needs to return a HttpOnly cookie to handle authentication via a secure way so that the JWT access and refresh tokens are not accessible via XSS. The client then sends the cookie with every subsequent request to the backend, automatically authenticating the requests as long as the JWT is not expired.

@matteioo matteioo added the enhancement New feature or request label Feb 22, 2024
@bresu
Copy link
Owner

bresu commented Feb 22, 2024

Will look into this

@bresu
Copy link
Owner

bresu commented Feb 22, 2024

Token pair creation works. How will the token be sent in the subsequent requests? In the form of a header? Need this so I can add it to the security middleware

@matteioo
Copy link
Collaborator Author

Due to the nature of HttpOnly cookies, the client is not able to extract the JWT token. Therefore, the token will be sent as a cookie with every request.

@bresu
Copy link
Owner

bresu commented Feb 24, 2024

I think I implemented this correctly, please test so I can close this issue

@matteioo
Copy link
Collaborator Author

matteioo commented Feb 3, 2025

Cookie currently sent via HTTP header Authorization. Will look into it once the domains for FE + BE are cleared. Domains needed for Cookie context: domain so we can set it to Lax if they share the same domain differing by subdomain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request prio:LOW
Projects
None yet
Development

No branches or pull requests

2 participants