<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cactus Thinking &#187; security</title>
	<atom:link href="http://www.cactus.org.cn/tag/security/feed" rel="self" type="application/rss+xml" />
	<link>http://www.cactus.org.cn</link>
	<description>程序是改出来的。</description>
	<lastBuildDate>Tue, 08 Jun 2010 12:26:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>限制同一用户同一时间只能一次登录系统(Acegi ConcurrentSessionFilter)</title>
		<link>http://www.cactus.org.cn/2008/09/acegi-concurrentsessionfilter.html</link>
		<comments>http://www.cactus.org.cn/2008/09/acegi-concurrentsessionfilter.html#comments</comments>
		<pubDate>Fri, 19 Sep 2008 22:27:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java世界]]></category>
		<category><![CDATA[acegi]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.dating07.com/?p=14</guid>
		<description><![CDATA[by 丑鑫鑫
如果系统是采用acegi security,你不需要另外编写额外的代码来满足这个需求，硬生生的写个Listener,Filter去监听或者拦截session，实现这个功能不叫重造轮子，应该叫做用别人的轮子重造轮胎  
采用Acegi 的系统限制同一用户同一时间只能一次登录系统步骤如下：
1.改写web.xml加入如下的语句
&#60;listener&#62;
&#60;listener-class&#62;org.acegisecurity.ui.session.HttpSessionEventPublisher&#60;/listener-class&#62;
&#60;/listener&#62;
这个监听器用来监听session生命期的事件
2.在acegi相关的spring bean配置文件加入：
&#60;bean id=&#8220;authenticationManager&#8221; class=&#8220;org.acegisecurity.providers.ProviderManager&#8221;&#62;
&#60;property name=&#8220;providers&#8221;&#62;
&#60;!&#8211; your providers go here &#8211;&#62;
&#60;/property&#62;
&#60;property name=&#8220;sessionController&#8221;&#62;&#60;ref bean=&#8220;concurrentSessionController&#8221;/&#62;&#60;/property&#62;
&#60;/bean&#62;
&#60;bean id=&#8220;concurrentSessionController&#8221; class=&#8220;org.acegisecurity.concurrent.ConcurrentSessionControllerImpl&#8221;&#62;
&#60;property name=&#8220;maximumSessions&#8221;&#62;&#60;value&#62;1&#60;/value&#62;&#60;/property&#62;
&#60;property name=&#8220;sessionRegistry&#8221;&#62;&#60;ref local=&#8220;sessionRegistry&#8221;/&#62;&#60;/property&#62;
&#60;/bean&#62;
&#60;bean id=&#8220;sessionRegistry&#8221; class=&#8220;org.acegisecurity.concurrent.SessionRegistryImpl&#8221;/&#62;
执行的过程为用户couxinxin登录到系统，在另一台机器上couxinxin这个用户又登录到系统，那么前一个用户couxinxin的Session将被后者冲掉（踢掉）
搞定Over  !      
 必须要使用acegi1.0.6及其以后的版本，不然会报出
java.lang.IllegalArgumentException: Authentication.getDetails() required
这是版本1.0.5的bug
描述为：
If concurrent session control is used with an authentication provider which doesn&#8217;t copy the authentication details object to the successful authentication [...]]]></description>
		<wfw:commentRss>http://www.cactus.org.cn/2008/09/acegi-concurrentsessionfilter.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tomcat ssl 双向认证</title>
		<link>http://www.cactus.org.cn/2008/08/tomcat-ssl-%e5%8f%8c%e5%90%91%e8%ae%a4%e8%af%81.html</link>
		<comments>http://www.cactus.org.cn/2008/08/tomcat-ssl-%e5%8f%8c%e5%90%91%e8%ae%a4%e8%af%81.html#comments</comments>
		<pubDate>Tue, 26 Aug 2008 12:17:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java世界]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://blog.dating07.com/?p=9</guid>
		<description><![CDATA[感谢雕虫小技的文章 http://blog.csdn.net/jasonhwang/archive/2008/04/29/2344768.aspx
]]></description>
		<wfw:commentRss>http://www.cactus.org.cn/2008/08/tomcat-ssl-%e5%8f%8c%e5%90%91%e8%ae%a4%e8%af%81.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
