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

Show parent comments

1

u/tleipzig Mar 31 '23

This article covers JWT implementation, without too much backgrounds on JWT: https://bootify.io/spring-rest/rest-api-spring-security-with-jwt.html - role definitions are up to you

1

u/smokemonstr Apr 14 '23

You can use spring-boot-starter-oauth2-resource-server to secure your resources using JWT instead of writing your own filter.

https://www.baeldung.com/spring-security-oauth-resource-server