How to split Spring security classes between a Grails application and a Java application?

I need to use the Spring Security User, Role / Authority and UserRole-join classes in both a Grails application and a Java application.

Where and how do I implement / generate these classes?

If I use the generated GORM / Groovy classes from Grails, how do I import and use them in a Java application (where do I process the Hibernate factory session myself)?

Or could I implement them in Java as Hibernate Entities and import / use them in a Grails application? (I did this successfully before with the "normal" (none- Spring Security) classes, but I did not know if / how to implement the get, create, remove, removeAll methods that the Spring Security Core plugin generated)

+5
source share
1 answer

I have a grails application that uses your second option.

There is a separate module for data processing, because in this project there are two different stand-alone applications (Grails server and server processor with REST api), and it also uses MongoDB (so all this GORM magic does not help there).

And Spring Security, used on both sides (network and backend), with various implementations, but everything works fine. Actually, this requires some small work to implement the required beans (see Spring Security Core Plugin), but it is not that difficult.

+1
source

All Articles