asp.net 使用 Cas 单点登录 配置

1:  配置web.config
2:   获取登录用户名称,判断是否为单点登录,再处理登录问题


web.config



	
		
	
	
	
   
		
			sap_CAS/login" timeout="30" defaultUrl="Default.aspx" cookieless="UseCookies" slidingExpiration="true"/>
		
		
			
			
		
		
			
		
		

	
		
		
			
			
		
	

 
  或者用户,验证登录 
  


public void Login()
{
    if (HttpContext.Current != null)
    {
        //是否已经form验证?
        string username = HttpContext.Current.User.Identity.IsAuthenticated ? HttpContext.Current.User.Identity.Name : "";

        if (!string.IsNullOrEmpty(username))
        {//如果当前用户已登录单点登录系统
            var loginInfo = 。。。
            if (loginInfo != null)
            {
                //缓存loginInfo...                    
            }
        }
        else
        {
            Logout();
        }
    }
}



你可能感兴趣的:(asp.net 使用 Cas 单点登录 配置)