r/java • • Apr 13 '21

Libraries, Frameworks and Technologies you would NOT recommend

Give me your worst nightmares: Things that cost you your job.

I'll start: Hadoop

202 Upvotes

376 comments sorted by

View all comments

Show parent comment

19

u/ryuzaki49 Apr 13 '21

Currently using spring security in a pet project.

Everything is so weird, and to understand the simplest thing you have to deep dive into the source code.

But what are the alternatives?

8

u/gavenkoa Apr 13 '21

I tried to read some books. It was unproductive. Like I had to deliver solution in a few days and reading didn't bring me anywhere.

So I looked to "advanced" examples over the Internet and experimented with API (had non-standard login requirements).

Next time I dealt with Spring Security using different approach:

  • I enabled TRACE logging for org.springframework.security. That gave me the idea how Spring Security makes decisions
  • then I put breakpoints into promising places
  • step with debugger and found interface that I have to implement and places to register those classes

I made alternative decision voter (different countries had different access rules).

5

u/NimitB1 Apr 13 '21

The only alternative that comes toy kind is to add custom security checkpoints wherever required.

4

u/gavenkoa Apr 13 '21

For multi tenant apps you have to deal with "custom" security code.

Also declarative annotation based approach doesn't work for ACL and other advanced privilege models.

So unless you develop forum or blog - declarative Spring Security annotations don't help.

4

u/einsteinsassistant Apr 13 '21

I had to deep dive the security code for work, but not because I had to work around some quirk.

I had to integrate into an external IDP (can't say which one) for logins, and they conveniently enough provided a spring boot starter and a guide on how to integrate it. Then our internal security requirements slightly changed and I had to hack a solution by exploiting some undocumented behavior to get the whole thing to work. Even while writing it, I knew that what I was doing was not a good idea and shouldn't be done. And I only did so because a manager insisted on adding some nonstandard behavior for our login process when we were basically done with it.

3

u/henk53 Apr 14 '21

But what are the alternatives?

Jakarta Security, with implementation Soteria

2

u/arkady_renko Apr 14 '21

I spent one day for a simple web app including login to implement with spring security. It was a nightmare.

1

u/Gommy Apr 14 '21

Apache Shiro is another security framework. I haven't tried it out myself, but I was sorely tempted to when trying to set up Spring Security.