Похожие чаты

Hi, I wanted to add authorization in a spring boot

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?

6 ответов

9 просмотров

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/** "

Ajith- Автор вопроса
Dmytro Buryak
It sounds good, but almost identical thing is done...

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 :)

Ajith- Автор вопроса
Ajith
?

He thinks that you're using basic authentication instead of implementing something that is more secure.

Ajith- Автор вопроса
Sander Koenders
He thinks that you're using basic authentication i...

What would be more secure? I was using jwt tokens with secure cookies.

Похожие вопросы

Обсуждают сегодня

А как старый хаскел с новым стыковать ? потому как тут работает https://play.haskell.org/saved/C3xpMzcd, а вот тут https://stepik.org/lesson/7602/step/9?unit=1473 нет ошибка C...
Fedor
75
Как Вы считаете нормально ли в двадцатых годах 21 века в ВУЗах Российской Федерации обучать студентов работе с TASM? Не слишком ли это "архаично"? (Если оффтоп или флейм для э...
Spiker01
52
Всем привет! поделитесь, пож-та, как кто дебажил / решал проблему с 504 Time out ошибкой от nginx, когда стучишься на свой vapor сервер? в логах /var/log/nginx/error.log е...
Paul
24
Как добавить ссылку в Быстрый доступ в Проводнике windows 10? Нашёл, как на power shell сделать, но может есть способ через Дельфи?
А
31
Читаю сейчас [нет, уже больше не читаю!] курсовую о Булгакове, написанную, похоже, с помощью ChatGPT. Это удивительный психоделический опыт. Текст в основном написан в стиле б...
✨ Uni [🌊 В отпуске]
1
Комрады, хотел уточнить. Проперть в OnDestroy юнита-хозяина по-прежнему доступна? И еще уточнение: finalization юнита наступает раньше или позже OnDestroy?
Ed Doc
48
drew demin: Подскажите пожайлуста какая система лучше подходит для данного железа и можно ли завести? и с каким загрузчиком А так же если платно обращаться сколько это будет ...
drew demin
3
is hex still a thing?
roams
19
Здравствуйте! Есть вопросы по ПК: 1.1. Безопасно ли запускать программы, которым я не доверяю, в виртуальной машине под KVM+qemu? (x86_64) 1.2. То же самое при использовании ...
Pavel
5
Hi everyone! I have a two-folded message to share today. First: updates and news, as we are being asked for those. We still want to go like we did the last 6 years: we w...
Marten | Unibright.io
31
Карта сайта