---
title: "自己动手实现sso"
author: "spjich"
date: "2016-05-09T17:42:34Z"
tags: []
categories: ["编程语言"]
slug: "sso"
draft: false
lastmod: "2016-05-09T17:41:47Z"
id: 2296910
url: "https://spjich.iteye.com/blog/2296910"
---

原公司业务中有sso系统，我当时完成的角色是接入，现在自己动手写了一个sso

项目地址

[https://git.oschina.net/spjich/sso-simple.git](https://git.oschina.net/spjich/sso-simple.git)

 

 

# 模拟sso跨域，同域登录

同域域名  
oa.ji.com  
sso.ji.com

跨域域名  
oa.com  
sso.com

# [](http://git.oschina.net/spjich/sso-simple#%E5%8A%A0%E5%AF%86%E7%AE%97%E6%B3%95)加密算法

cookie内容加密-ASE  
服务器间信息验证-RSA证书

# [](http://git.oschina.net/spjich/sso-simple#%E5%90%8C%E5%9F%9F%E6%B5%81%E7%A8%8B%E5%9B%BE)同域流程图

![TMD](http://git.oschina.net/spjich/sso-simple/raw/master/pic/sso%E5%90%8C%E5%9F%9F.png)

# [](http://git.oschina.net/spjich/sso-simple#%E8%B7%A8%E5%9F%9F%E6%B5%81%E7%A8%8B%E5%9B%BE)跨域流程图

![TMD](http://git.oschina.net/spjich/sso-simple/raw/master/pic/sso%E8%B7%A8%E5%9F%9F.png)

# [](http://git.oschina.net/spjich/sso-simple#%E5%88%87%E6%8D%A2%E6%A8%A1%E6%8B%9F%E6%97%B6%E9%9C%80%E8%A6%81%E4%BF%AE%E6%94%B9%E7%9A%84%E9%85%8D%E7%BD%AE)切换模拟时需要修改的配置

ParamConst  
OaConst  
sso-oa工程的spring.xml