I have a tomcat 7 setup with oldApp.war and newApp.war deployed on it. Both the applications share the same login credentials for users on the database.
I can access the apps using https://localhost/oldApp
and https:localhost/newApp
respectively.
My oldApp is a Spring MVC java application and when the user is logged into the oldApp I want to have a link which will take the user into the newApp without asking for the login credentials.
I want to know how to implement SSO to do this. I preferably don't want to run any external service to handle this.
Thanks in advance.
Tomcat provides a builtin SSO support using a valve. The Single Sign On Valve caches credentials on the server side, and then invisibly authenticate users when they reach different web applications. Credentials are stored in a host-wide session which means that SSO will be effective throughout the session.
3.2.xml configuration file that is inside the WEB-INF folder of each servlet. All the web apps that require SSO must have protected resources and use one of the Tomcat authentication methods.
Tomcat SSO Commercial IdP Integrations AD is the most popular IDP as Windows servers are widely used. Supports SAML & OpenID with Active Directory integration.
In Basic authentication, if you try to hit a web application url that is protected and you are currently unauthenticated, a popup window appears and you enter a particular username/password, which gets sent to Tomcat. Tomcat checks to see that the sent username and password match a user entry in tomcat-users.
Update: Its 2018 and the below info is out of date. If you’re starting a new application then use a federated identity protocol like Open ID Connect and you’ll get SSO for free.
There are a few approaches you could take:
You can implement SSO in many different ways:
SAML 2.0 has many implementations for Identity/Service provider roles.
For an IDP implementations list I can point you to this stackoverflow post: https://stackoverflow.com/a/761774/126414
If you are planning to implement a service provider there is a nice spring extension: http://static.springsource.org/spring-security/site/extensions/saml/index.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With