REST API. I used jwt tokens in a cookie with an interceptor check if the user is authorized or not and i have to call a custom function in each controller with the request as parameter to get the user details. Does this implementation has any issue? Should I move to spring security with a custom filter instead? Would it be easy to get the user details if spring security is used instead?
It sounds good, but almost identical thing is done by spring security. Personally I recommend to not waste your time on building custom homebrew solution, but rather spend this time on learning spring security. The benefits: - spring security is more mature - it's both more flexible and better tested than what you'll create - it's ubiquitous, so by learning how to do it with spring security, you'll have a highly relevant skill in your skill set - it's better designed, believe me)) think of how much code you would need to change in your custom solution if you had to add new rule like "user should have ABC_RW role for doing POST,DELETE,PUT on url /a/b/c/*/protected/** "
Spring security was an overkill for the project. Thats why i decided to go with a custom solution. I don't need roles and all. I will spend some time to learn spring security more. Thank you :)
Basic auth goes brrrrrrrr
He thinks that you're using basic authentication instead of implementing something that is more secure.
What would be more secure? I was using jwt tokens with secure cookies.
Обсуждают сегодня