Jwt Auth Issue
This is the exception in postman i am getting
12 Replies
⌛
This post has been reserved for your question.
Hey @Danix! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
What i am not adding in it so i am getting this error ?
The problem is that you are using formlogin but your session strategy is stateless, and the use of formlogin depends on enabling sessions
Try to use "if required" instead of stateless or remove formlogin if you want to use JWT authentication
Do you have any doc for it ?
About session control and management with spring security, just an article by baeldung: https://www.baeldung.com/spring-security-session
Baeldung
Control the Session with Spring Security | Baeldung
Configure Sessions with Spring Security - set up Concurrent Sessions, enable Session Fixation Protection and prevent URLs from containing Session information.
Now i did something like this but still not generating the token and not even getting it in the header ! Now i am able to login in buit without jwt token !
I want to create a frontend for the form and generate a jwt token when the user's credentials are correct
Where are you storing the token?
If you just store the token in the header and send it to the client, it will only be valid for a single request.
Consider storing in a Cookie, or sessionStorage
I recommend using a cookie if the token is not needed on the client side.
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
I want to make the jwt for the backend and a form for the frontend with react then which approach should I have to follow ?
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
Try storing in local storage or cookie/session.