开发者

How to share Spring Security classes between a Grails app and a Java app?

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

Where and how should I implement/generate these classes?

If I use the generated GORM/Groovy classes from Grails, how would I import and use them in the Java app (where I handle th开发者_如何学Ce Hibernate session factory myself)?

Or would I implement them in Java as Hibernate Entities and import/use them in the Grails app? (I have done this successfully before with 'normal' (none-Spring Security) classes, but I would not know whether/how to implement the get, create, remove, removeAll methods that the Spring Security Core plugin has generated)


I've an grails app where your second option is used.

There is an separate module for data manipulations, because this project have two different standalone apps (grails website and backend processor with REST api), and also it uses MongoDB (so, all this GORM magic doesn't help there).

And Spring Security used on both sides (web and backend), with different implementations, but everything works fine. Actually it requires some little work on implementing required beans (look inside Spring Security Core plugin), but it isn't so complicated.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜