<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Custom AuthenticationProcessingFilter for spring security to perform actions on login</title>
	<atom:link href="http://www.codercorp.com/blog/spring/security-spring/custom-authenticationprocessingfilter-for-spring-security-to-perform-actions-on-login.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.codercorp.com/blog/spring/security-spring/custom-authenticationprocessingfilter-for-spring-security-to-perform-actions-on-login.html</link>
	<description>Everything java</description>
	<lastBuildDate>Wed, 28 Jul 2010 18:37:29 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: NaiveGeek</title>
		<link>http://www.codercorp.com/blog/spring/security-spring/custom-authenticationprocessingfilter-for-spring-security-to-perform-actions-on-login.html/comment-page-1#comment-622</link>
		<dc:creator>NaiveGeek</dc:creator>
		<pubDate>Thu, 01 Apr 2010 21:51:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.codercorp.com/blog/?p=178#comment-622</guid>
		<description>Hey Gurav, 
 Thanks for the info posted. It explained lot clearly and helped me successfully accomplish my task
Naive Geek</description>
		<content:encoded><![CDATA[<p>Hey Gurav,<br />
 Thanks for the info posted. It explained lot clearly and helped me successfully accomplish my task<br />
Naive Geek</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andi</title>
		<link>http://www.codercorp.com/blog/spring/security-spring/custom-authenticationprocessingfilter-for-spring-security-to-perform-actions-on-login.html/comment-page-1#comment-514</link>
		<dc:creator>Andi</dc:creator>
		<pubDate>Mon, 21 Sep 2009 10:16:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.codercorp.com/blog/?p=178#comment-514</guid>
		<description>Hi!
I have the same problem. It works only for filters=&quot;none&quot;, but then the redirect to https (reqires-channel=&quot;https&quot;) doesn&#039;t work... Any idea?</description>
		<content:encoded><![CDATA[<p>Hi!<br />
I have the same problem. It works only for filters=&#8221;none&#8221;, but then the redirect to https (reqires-channel=&#8221;https&#8221;) doesn&#8217;t work&#8230; Any idea?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fuz</title>
		<link>http://www.codercorp.com/blog/spring/security-spring/custom-authenticationprocessingfilter-for-spring-security-to-perform-actions-on-login.html/comment-page-1#comment-507</link>
		<dc:creator>Fuz</dc:creator>
		<pubDate>Wed, 02 Sep 2009 19:04:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.codercorp.com/blog/?p=178#comment-507</guid>
		<description>Great stuff!
everything almost works! but look at this:

here you wrote filters=&quot;none&quot;. if you replace this with access=&quot;IS_AUTHENTICATED_ANONYMOUSLY&quot; browser goes to unstoppable redirecting. do you know what is it?
Also spring security error handling dissapeared - server HTTP Status 401 error page now appears.</description>
		<content:encoded><![CDATA[<p>Great stuff!<br />
everything almost works! but look at this:</p>
<p>here you wrote filters=&#8221;none&#8221;. if you replace this with access=&#8221;IS_AUTHENTICATED_ANONYMOUSLY&#8221; browser goes to unstoppable redirecting. do you know what is it?<br />
Also spring security error handling dissapeared &#8211; server HTTP Status 401 error page now appears.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gaurav Arora</title>
		<link>http://www.codercorp.com/blog/spring/security-spring/custom-authenticationprocessingfilter-for-spring-security-to-perform-actions-on-login.html/comment-page-1#comment-497</link>
		<dc:creator>Gaurav Arora</dc:creator>
		<pubDate>Tue, 18 Aug 2009 05:28:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.codercorp.com/blog/?p=178#comment-497</guid>
		<description>Read &lt;a href=&quot;http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/ch15s09.html&quot; rel=&quot;nofollow&quot;&gt;this link&lt;/a&gt; on an idea of how to handle exceptions globally. This is possibly the easiest way to do it.</description>
		<content:encoded><![CDATA[<p>Read <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/ch15s09.html" rel="nofollow">this link</a> on an idea of how to handle exceptions globally. This is possibly the easiest way to do it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sunny</title>
		<link>http://www.codercorp.com/blog/spring/security-spring/custom-authenticationprocessingfilter-for-spring-security-to-perform-actions-on-login.html/comment-page-1#comment-496</link>
		<dc:creator>sunny</dc:creator>
		<pubDate>Thu, 13 Aug 2009 17:14:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.codercorp.com/blog/?p=178#comment-496</guid>
		<description>I have customized AuthenticationProcessingFilter for custom authentication. All working fine except, upon the unsuccess authentication, I like to display a custom message. So I am throwing BadCredentialExecption with the custom message. Upong the unsucessfull attempt, it never takes to the login page and never displays custom message. I see all the stacktrace on the page. URL shows j_spring_security_check.

Any idea pls? I appreciate it

	@Override
	protected void onUnsuccessfulAuthentication(HttpServletRequest request,
			HttpServletResponse response, AuthenticationException failed) throws AuthenticationException, IOException
	{
throw new BadCredentialsException(&quot;Log In information not valid: Please enter a valid Username and associated Password.&quot;);
	}</description>
		<content:encoded><![CDATA[<p>I have customized AuthenticationProcessingFilter for custom authentication. All working fine except, upon the unsuccess authentication, I like to display a custom message. So I am throwing BadCredentialExecption with the custom message. Upong the unsucessfull attempt, it never takes to the login page and never displays custom message. I see all the stacktrace on the page. URL shows j_spring_security_check.</p>
<p>Any idea pls? I appreciate it</p>
<p>	@Override<br />
	protected void onUnsuccessfulAuthentication(HttpServletRequest request,<br />
			HttpServletResponse response, AuthenticationException failed) throws AuthenticationException, IOException<br />
	{<br />
throw new BadCredentialsException(&#8221;Log In information not valid: Please enter a valid Username and associated Password.&#8221;);<br />
	}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dario</title>
		<link>http://www.codercorp.com/blog/spring/security-spring/custom-authenticationprocessingfilter-for-spring-security-to-perform-actions-on-login.html/comment-page-1#comment-482</link>
		<dc:creator>Dario</dc:creator>
		<pubDate>Thu, 11 Jun 2009 19:46:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.codercorp.com/blog/?p=178#comment-482</guid>
		<description>the previus post didn&#039;t show the following line 
&quot;  &quot;

after &quot;because for the username I can do &quot;
And before &quot;But because the object &quot;
Sorry for the mess..  :)</description>
		<content:encoded><![CDATA[<p>the previus post didn&#8217;t show the following line<br />
&#8221;  &#8221;</p>
<p>after &#8220;because for the username I can do &#8221;<br />
And before &#8220;But because the object &#8221;<br />
Sorry for the mess..  <img src='http://www.codercorp.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dario</title>
		<link>http://www.codercorp.com/blog/spring/security-spring/custom-authenticationprocessingfilter-for-spring-security-to-perform-actions-on-login.html/comment-page-1#comment-481</link>
		<dc:creator>Dario</dc:creator>
		<pubDate>Thu, 11 Jun 2009 19:43:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.codercorp.com/blog/?p=178#comment-481</guid>
		<description>Hi! thanks for this very usefull tutorial. Anyway reading it, when you say 

&quot;you don’t necessarily need to do all this work just to put your user’s details in the session. You can instead write a custom UserDetailsService which returns an extended User object (or your own implementation of UserDetails) which contains your user details.&quot;

I followed the article and I implemented my UserDetailsService, but now How do I get user details from the session? I mean, in a JSP page how do I get for example the user email? because for the username I can do 

But because the object &quot;Principal&quot; has a method called .getName()
How can I do a similar thing with other user details?

Many thanks in advance for the answer
Dario</description>
		<content:encoded><![CDATA[<p>Hi! thanks for this very usefull tutorial. Anyway reading it, when you say </p>
<p>&#8220;you don’t necessarily need to do all this work just to put your user’s details in the session. You can instead write a custom UserDetailsService which returns an extended User object (or your own implementation of UserDetails) which contains your user details.&#8221;</p>
<p>I followed the article and I implemented my UserDetailsService, but now How do I get user details from the session? I mean, in a JSP page how do I get for example the user email? because for the username I can do </p>
<p>But because the object &#8220;Principal&#8221; has a method called .getName()<br />
How can I do a similar thing with other user details?</p>
<p>Many thanks in advance for the answer<br />
Dario</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gaurav Arora</title>
		<link>http://www.codercorp.com/blog/spring/security-spring/custom-authenticationprocessingfilter-for-spring-security-to-perform-actions-on-login.html/comment-page-1#comment-477</link>
		<dc:creator>Gaurav Arora</dc:creator>
		<pubDate>Tue, 02 Jun 2009 13:50:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.codercorp.com/blog/?p=178#comment-477</guid>
		<description>You can access the session from the request..</description>
		<content:encoded><![CDATA[<p>You can access the session from the request..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SDB</title>
		<link>http://www.codercorp.com/blog/spring/security-spring/custom-authenticationprocessingfilter-for-spring-security-to-perform-actions-on-login.html/comment-page-1#comment-475</link>
		<dc:creator>SDB</dc:creator>
		<pubDate>Mon, 01 Jun 2009 17:36:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.codercorp.com/blog/?p=178#comment-475</guid>
		<description>Hello Gaurav,

Thanks for the post. 
I have a requirement. After successful login the user is taken to the welcome page. From there he can click on a link to navigate to another page. In the second page, I need to display some details regarding the user logged in. So my requirement is, when the user clicks the link in Welcome page, it should be taken to the controller where there will be come calculations and  store the value in a session variable. When the page is rendered, then the value is to be displayed .So my doubt is how we can access the session variable in Controller java classes. Or is there any other way to attain this functionality.

Please give me some pointers. I am new to spring. My application is using struts 2, spring, spring security and hibernate

Thanks,
SDB</description>
		<content:encoded><![CDATA[<p>Hello Gaurav,</p>
<p>Thanks for the post.<br />
I have a requirement. After successful login the user is taken to the welcome page. From there he can click on a link to navigate to another page. In the second page, I need to display some details regarding the user logged in. So my requirement is, when the user clicks the link in Welcome page, it should be taken to the controller where there will be come calculations and  store the value in a session variable. When the page is rendered, then the value is to be displayed .So my doubt is how we can access the session variable in Controller java classes. Or is there any other way to attain this functionality.</p>
<p>Please give me some pointers. I am new to spring. My application is using struts 2, spring, spring security and hibernate</p>
<p>Thanks,<br />
SDB</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jalpesh Patadia</title>
		<link>http://www.codercorp.com/blog/spring/security-spring/custom-authenticationprocessingfilter-for-spring-security-to-perform-actions-on-login.html/comment-page-1#comment-455</link>
		<dc:creator>Jalpesh Patadia</dc:creator>
		<pubDate>Mon, 04 May 2009 18:05:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.codercorp.com/blog/?p=178#comment-455</guid>
		<description>Hello Gaurav,

Thanks for this article. It certainly helps to resolve one issue I&#039;m having. 

What I now need is a way to have multiple  elements in my web site. One which uses the auto-config=true (standard form based auth), and one which uses a custom  element for RESTful access, with it&#039;s own AuthEntryPoint. 

I can easily create two filter-mappings in web.xml, but I have two problems :

a) Spring security (2.0.4) does not allow multiple http elements in your applicationContext files.
b) Most of the beans in my application are going to be shared with both the access points in my site (form based and REST based)

I&#039;ve searched around, but haven&#039;t found any examples on getting this resolved.

Would you have any suggestions on how would I go about doing that ?

Thanks,


Jalpesh.</description>
		<content:encoded><![CDATA[<p>Hello Gaurav,</p>
<p>Thanks for this article. It certainly helps to resolve one issue I&#8217;m having. </p>
<p>What I now need is a way to have multiple  elements in my web site. One which uses the auto-config=true (standard form based auth), and one which uses a custom  element for RESTful access, with it&#8217;s own AuthEntryPoint. </p>
<p>I can easily create two filter-mappings in web.xml, but I have two problems :</p>
<p>a) Spring security (2.0.4) does not allow multiple http elements in your applicationContext files.<br />
b) Most of the beans in my application are going to be shared with both the access points in my site (form based and REST based)</p>
<p>I&#8217;ve searched around, but haven&#8217;t found any examples on getting this resolved.</p>
<p>Would you have any suggestions on how would I go about doing that ?</p>
<p>Thanks,</p>
<p>Jalpesh.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
