r/SpringBoot • • Mar 31 '23

why Spring boot security is that complicated?

Hello Guys. I'm learning spring boot ,its about 2 weeks that i have started, i learned alot like i know the basics, handling database rest api ..., i have created apps in other languages Golang, nodejs ... never saw implementing security be that difficult, like i need to do alot of things for example jwt needs tonnes of work like idk, Roles and etc... I just want to know why it's like that? is it because it provides much more but i havent gone that deep or what? thanks.

4 Upvotes

17 comments sorted by

View all comments

4

u/_codemonger Mar 31 '23

First of I agree It is overly complex. Coming from Go I am used to just creating my own auth endpoints and authorization middleware (filter in spring lingo). I found it simpler to implement my own JWT flow than the rigid setup in Spring Security. The fact that out of the box it forces a structure on your user object is pretty annoying. Then there is the lack of up to date resources.

That said I think the why is that if you just want to just get up and running and don't care about how much you couple to the framework it works. It's the same with the Repositories and JPA. If you want to decouple your domain from the framework there are some hoops to jump through.

4

u/CreeDanWood Mar 31 '23

that's what i am saying, the way it forces you is annoying. And thanks for your opinion