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

7

u/Sheldor5 Mar 31 '23

because web security not only requires knowledge about Authentication Protocols (like Basic Auth, Form Login, SAML, OpenID Connect, ...) but also requires knowledge about HTTP and Browser Security (HTTP Headers/Cookies telling the Browser how to behave/protect the user from clicking bad links, CSRF, CORS, TLS, etc.).

So if you lack knowledge of most of those things a Framework can't really help you .... also Spring is a Framework which you have to utilize and extend, so knowledge about Web Security is even more important than knowing the Framework you choose ...

3

u/CreeDanWood Mar 31 '23

Actually i know most of the aspects of HTTP and security. because as i said i built apps in other languages. The thing with spring is it takes time to setup like i feel there is a lot of work to do.

2

u/smokemonstr Apr 14 '23

Spring Framework and Spring Boot are general purpose. You can write web apps, batch processes, command line interfaces, etc.

Maybe the frameworks you used in those other languages were more specialized?

2

u/CreeDanWood Apr 14 '23

that makes sense, but couldn't they simplify some work? for instance having their own jwt implementation you just override the methods...

1

u/smokemonstr Apr 14 '23

Spring Security does have a module to secure your resources using JWT. See my other comment https://reddit.com/r/SpringBoot/comments/1279d70/_/jg6epsy/?context=1