How to Implement SSO on existing tomcat web application

后端 未结 4 1806
忘了有多久
忘了有多久 2020-12-08 21:26

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 acces

4条回答
  •  借酒劲吻你
    2020-12-08 22:03

    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:

    1. You could use Tomcat for authentication and use Tomcat's single sign on capabilities. If you're currently using Spring to authenticate the user you may need to change some things. Also, depending on how you're doing authentication, Tomcat's authentication may not be configurable enough.
    2. You could setup a third, CAS, servlet (or something similar), which both web applications authenticate against.
    3. You could set this up yourself using Spring and pre-authenticated filters. You would basically have to write your own pre-authenticated filter which checked some location that both servlets had access to (database?, shared context?) for existing credentials before falling back to old authentication methods. You'll want to make sure to clear this authentication in a filter somewhere so the next request doesn't get to automatically inherit the previous requests credentials.

提交回复
热议问题