<?xml version="1.0"?><rss version="2.0">
<channel>
<title>Byte Slinger - Responses</title>
<link>http://byteslinger.com/</link>
<description>It&#039;s your world, I&#039;m just coding in it.</description>
<language>en</language>
<managingEditor>Marty</managingEditor>
<lastBuildDate>Sat, 12 May 2007 00:10:02 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  <item>
    <title>Re: Acegi Security and Site Minder</title>
    <link>http://byteslinger.com/2007/03/30/1175311104068.html#comment1178928602667</link>
    <description>
      &lt;pre&gt;/**
 * @author Marty Milligan
 *
 * This class is used to get around limitation in the default Acegi implementation. 
 * 
 */
package com.milligansisland.open.security.acegi;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.acegisecurity.Authentication;
import org.acegisecurity.context.HttpSessionContextIntegrationFilter;
import org.acegisecurity.context.SecurityContext;
import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;

/**
 * 
 * Extend the existing SiteminderAuthenticationProcessingFilter to simply check that the user has been authenticated
 * and not care about the URL that is being accessed.  This filter must be configured to only process secured resources.
 * 
 */
public class SiteminderAuthenticationProcessingFilter extends org.acegisecurity.ui.webapp.SiteminderAuthenticationProcessingFilter {

	protected boolean requiresAuthentication(HttpServletRequest request, HttpServletResponse response) { 
		boolean bAuthenticated = false; // define return value
		SecurityContext context = (SecurityContext)request.getSession().getAttribute(HttpSessionContextIntegrationFilter.ACEGI_SECURITY_CONTEXT_KEY);

		if (context != null) {//if there is a security context
		   Authentication auth = context.getAuthentication();              
		   if (auth != null &amp;amp;&amp;amp; auth instanceof UsernamePasswordAuthenticationToken) { //check for an authentication token
				   UsernamePasswordAuthenticationToken token = (UsernamePasswordAuthenticationToken)auth;                  
				   bAuthenticated = token.isAuthenticated(); //make sure it is authenticated
		   } 
		} 
		return !bAuthenticated; //return true if user needs to be authenticated
	} 

}

&lt;/pre&gt;</description>
    <author>Marty</author>
    <comments>http://byteslinger.com/2007/03/30/1175311104068.html#comments</comments>
    <guid isPermaLink="true">http://byteslinger.com/2007/03/30/1175311104068.html#comment1178928602667</guid>
    <pubDate>Sat, 12 May 2007 00:10:02 GMT</pubDate>
  </item>
  <item>
    <title>Re: Acegi Security and Site Minder</title>
    <link>http://byteslinger.com/2007/03/30/1175311104068.html#comment1178297364779</link>
    <description>
      Is it possible for you to paste the code for the filter?</description>
    <author>Anonymous</author>
    <comments>http://byteslinger.com/2007/03/30/1175311104068.html#comments</comments>
    <guid isPermaLink="true">http://byteslinger.com/2007/03/30/1175311104068.html#comment1178297364779</guid>
    <pubDate>Fri, 04 May 2007 16:49:24 GMT</pubDate>
  </item>
  </channel>
</rss>
