单点登录(Single Sign On),简称为 SSO,是目前比较流行的企业业务整合的解决方案之一。
SSO的定义是在多个应用系统中,用户只需要登录一次就可以访问所有相互信任的应用系统。它包括可以将这次主要的登录映射到其他应用中用于同一个用户的登录的机制。
当用户第一次访问应用系统1的时候,因为还没有登录,会被引导到认证系统中进行登录;
根据用户提供的登录信息,认证系统进行身份效验,如果通过效验,应该返回给用户一个认证的凭据--ticket;
用户再访问别的应用的时候就会将这个ticket带上,作为自己认证的凭据,应用系统接受到请求之后会把ticket送到认证系统进行效验,检查ticket的合法性。如果通过效验,用户就可以在不用再次登录的情况下访问应用系统2和应用系统3了实现步骤:
一,在winform上通过认证中心实现登陆
public CKey UserLogin(CUser cuser)
二,登陆后,认证中心要生成一个票据,并返回给winform
CKey ckey=new CKey ();
ckey.client_key = DateTime.Now.ToString();
ckey.token = System.Guid.NewGuid().ToString () ;
ckey.user = cuser.user;
UpdateKey(ckey);
三,在winform如果要使用web的功能时
System.Diagnostics.Process.Start(@"http://localhost/WebLogin/Login.aspx?user=" + ckey.user + "&client_key=" + ckey.client_key + "&token=" + ckey.token);
四,web页面需要到验证中心去验证
public bool UserCheck(CKey ckey)
五,OK
六,数据库表

























