I have two web applications running in two different tomcat servers. I want to implement single sign on feature in one of my applications. Users in both the applications are same. Can anyone tell me how to implement it?
If you have any code snippets, please send it to me.
Thanks in advance.
Regards,
Sakthi
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35251
7
posted
0
Tomcat has the SSO Valve, but I think that only works within a single Tomcat instance.
When Application B receives this request, it makes a http call to Application A to verify this information.
In other words it sends a http request (server to server) like: http://WebApplicationA/verifyUserSession?sessionId=ABC&user=me@me.com. WebApplication A checks its list of logged-in users/sessions and responds with a VERIFIED or FAILURE.
If the response was VERIFIED, WebApplicationB knows this is a logged in user inside WebApplicationA - and it proceeds to create a session for the user, and allows him in.
So, thats the idea.
You will notice that - you must arrive at the second application via a link from the first application, so that you can present your existing sessionId/username for verification.
If I understand correctly, then this provides SSO across web apps running on a single servlet container instance, yes? Or can it be used across multiple instances?
Pat Gonzalez
Greenhorn
Joined: Oct 18, 2009
Posts: 19
posted
0
Correct.
Across many web apps, across many instances, and across many physical hosts.
This works as long as each web app is configured to use the filter.
For example, it is possible to configure an app server such that any web app
running on that app server will invoke a specified filter.
It is also possible to configure an app server such that each web app must
be configured to invoke a specified filter.
The former is more of a global setting whereas the latter is local to the web app.
In other words, the number of physical host is irrelevant and/or the number
of app server instances on a physical host.
The number of web apps is also irrelevant... as long as the app server instance
that the web app is running on has the servlet filter installed.