sso single sign-on system architecture

sso single sign-on system architecture

1. Single sign-on system

Single sign-on (sso system) is mainly used to solve the problem of user login between multiple systems in the company. In an environment where multiple systems coexist, users can gain the trust of the system when they log in to one system and access other systems without having to re-enter the account and password on the login page.

 

2. SSO system architecture diagram

 

 

3. Realization principle

 3.1 Application configuration SSO interceptor

<mvc:interceptors>
		<mvc:interceptor>
			<mvc:mapping path="/**" />
			<bean class="com.mengka.usercenter.interceptor.SSOInterceptor">
			</bean>
		</mvc:interceptor>
</mvc:interceptors>

 

3.2 usercenter-client

① Username and password validity verification;

② Save the user's ssosessionid in the cookie;

③ If the page ssosessionid expires, the login will be jumped out;

 

new Cookie("ssosessionid","044101331");

 

3.3 Cluster session storage

Here, redis is used to centrally store sessions to solve the problem of distributed cluster session synchronization;

 

Redis stores user session data:

long time = 2*3600;
redisClient.put("044101331",time,userId);

 

mysql stores user basic information data:

userDAO.querybyId(userId);

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327046246&siteId=291194637