<?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>Radek's Tech Blog &#187; acegi</title>
	<atom:link href="http://urbas.tk/index.php/tag/acegi/feed/" rel="self" type="application/rss+xml" />
	<link>http://urbas.tk</link>
	<description>Radoslaw H. Urbas homepage / blog</description>
	<lastBuildDate>Tue, 01 Jun 2010 20:31:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Acegi RoleVoter</title>
		<link>http://urbas.tk/index.php/2008/06/30/acegi-rolevoter/</link>
		<comments>http://urbas.tk/index.php/2008/06/30/acegi-rolevoter/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 17:58:47 +0000</pubDate>
		<dc:creator>Radoslaw Urbas</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[acegi]]></category>
		<category><![CDATA[rolevoter]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://urbas.tk/?p=37</guid>
		<description><![CDATA[Adding new role to Acegi secured application may be painful sometime. Tip of the day: by default RoleVoter is only accepting roles with names starting with prefix ROLE_ (take a look on javadoc here). You easily can change this prefix while defining RoleVoter bean (this is usually configured in file WEB-INF/security.xml) &#60;bean class=&#34;org.acegisecurity.vote.RoleVoter&#34;&#62; &#60;property name=&#34;rolePrefix&#34;&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Adding new role to Acegi secured application may be painful sometime.</p>
<p>Tip of the day: by default RoleVoter is <strong>only</strong> accepting roles with names starting with prefix <code>ROLE_</code> (take a look on javadoc <a href="http://www.acegisecurity.org/acegi-security/apidocs/org/acegisecurity/vote/RoleVoter.html#setRolePrefix(java.lang.String)" target="_blank">here</a>). You easily can change this prefix while defining RoleVoter bean (this is usually configured in file <code>WEB-INF/security.xml</code>)</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.acegisecurity.vote.RoleVoter&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;rolePrefix&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>YOUR_CUSTOM_PREFIX<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>That&#8217;s all for today about Acegi <img src='http://urbas.tk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://urbas.tk/index.php/2008/06/30/acegi-rolevoter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Capturing log-in event in Acegi</title>
		<link>http://urbas.tk/index.php/2008/06/14/capturing-log-in-event-in-acegi/</link>
		<comments>http://urbas.tk/index.php/2008/06/14/capturing-log-in-event-in-acegi/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 15:05:22 +0000</pubDate>
		<dc:creator>Radoslaw Urbas</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[acegi]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[struts]]></category>

		<guid isPermaLink="false">http://urbas.tk/?p=31</guid>
		<description><![CDATA[Adding some custom code that is supposed to be launched while user logs in it isn&#8217;t available out of the box but it can be done easily. In order to do this you have to implement interface org.springframework.context.ApplicationListener. public void onApplicationEvent&#40;ApplicationEvent event&#41; &#123; if &#40;event instanceof AuthenticationSuccessEvent&#41; &#123; AuthenticationSuccessEvent authEvent = &#40;AuthenticationSuccessEvent&#41; event; String username [...]]]></description>
			<content:encoded><![CDATA[<p>Adding some custom code that is supposed to be launched while user logs in it isn&#8217;t available out of the box but it can be done easily. In order to do this you have to implement interface <code>org.springframework.context.ApplicationListener</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onApplicationEvent<span style="color: #009900;">&#40;</span>ApplicationEvent event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>event <span style="color: #000000; font-weight: bold;">instanceof</span> AuthenticationSuccessEvent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        AuthenticationSuccessEvent authEvent <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>AuthenticationSuccessEvent<span style="color: #009900;">&#41;</span> event<span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> username <span style="color: #339933;">=</span> authEvent.<span style="color: #006633;">getAuthentication</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">// Any custom logic</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Such listener has to be registered. In order to do this &#8211; just create a bean in xml configuration file where other Acegi related beans are declared (usually security.xml or applicationContext-security.xml).</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;my.package.SomeExampleListener&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;someExampleManager&quot;</span> <span style="color: #000066;">ref</span>=<span style="color: #ff0000;">&quot;someExampleManager&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>You can inject any required dependencies here.</p>
<p>That&#8217;s all!</p>
]]></content:encoded>
			<wfw:commentRss>http://urbas.tk/index.php/2008/06/14/capturing-log-in-event-in-acegi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
