Can spring support sharing multiple applications?

Does spring support multiple applications sharing a common user base?

eg. 2 separate web applications are somehow connected to the same database to get information related to the user (username, password, and possibly even roles).

The idea is something like asp.net membership

it works like this: you can have 10 websites, all of them pull their membership APIs from the same data source. Security (roles) and site mappings are configured through this membership API.

Usually, an app is released. Then you release another application, and then your customers ask if you can combine users, etc. The asp.net member solves this problem from the start.

Update

I do not ask you to enter one character in the sense that you can go to any site just by logging in once. But, rather, you have the same credentials that can be used on all sites.

+4
source share
3 answers

A single database is accessed by several applications, including Spring applications. Just provide access to this database for each application, usually through a data source (and yes, a Java application can use multiple data sources).

[EDIT] The purpose of the OP is actually not clear. According to some comments, it seems that the question may be related to SSO. In this case, I would suggest looking at Spring Security or implementing a CAS implementation, such as JA-SIG CAS , or Spring Security with CAS .

PS: I don't want to be rude, but you have to learn How to Ask Smart Way Questions . For example, here you should disclose your goal instead of asking for a specific solution (see Describe the goal, not the step ). Firstly, readers cannot guess that you are not telling them, and this is very frustrating (even if Iโ€™m happy to help). Secondly, you will get much better answers (and avoid disappointments on both sides). Seriously, read this article, it's really worth it.

+3
source

Sure. Look at Terracotta with Spring. This allows the use of distributed cache. those. you can write a hash map, and it will transparently replicate to the hash map of another JVM instance (such as an application).

http://www.springsource.org/node/279

also google "cluster spring".

You can put anything in the data structure: user information, roles, etc. It also gives you a small little clustering solution where you can easily load balance sessions between multiple instances of the application.

+1
source

Yes ... sort of. Take a look at SpringSecurity.

I say โ€œkindโ€ because Spring does not currently offer a ready-made solution to the user account management problem. You have the choice to connect to an existing solution (such as LDAP) or to transfer your own โ€œuser data serviceโ€ and account management tools.

In addition, SpringSecurity has not yet (AFAIK) a true single sign-on solution.

But, of course, after you have implemented the SpringSecurity authentication / access control solution, it should be easy to apply to multiple sites with a single user account ... or not.

EDIT in response to the comments, when I say that SpringSecurity + LDAP is not a ready-made solution for managing user accounts, I mean that this is not something (like OP) just add it to Spring web applications and expand them in tomcat / whatever. Instead, he should have

  • LDAP performance research
  • LDAP selection and implementation,
  • install the LDAP implementation,
  • configure and configure LDAP as needed,
  • integrates with SpringSecurity,
  • They expect to implement extensions of their web applications so that remote users can register themselves, change their passwords, change their profiles, etc.

In my opinion, SpringSecurity + LDAP is a good solution if you already have enterprise LDAP setup (or if you have extensive LDAP experience), but this does not meet the OP requirements for a simple solution.

0
source

All Articles