<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/clearspace/rss" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Blog Posts From Jivespace Community Blog Tagged With sso</title>
    <link>http://www.jivesoftware.com/jivespace/blogs/jivespace</link>
    <description>Jivespace Developer Community Blog</description>
    <pubDate>Sat, 05 Jul 2008 15:31:23 GMT</pubDate>
    <generator>Jive SBS 3.0.8 (http://jivesoftware.com/products/clearspace/)</generator>
    <dc:date>2008-07-05T15:31:23Z</dc:date>
    <item>
      <title>Customization Part 6: Custom Authentication and User Data Providers</title>
      <link>http://www.jivesoftware.com/jivespace/blogs/jivespace/2008/07/11/customization-part-6-custom-authentication-and-user-data-providers</link>
      <description>&lt;!-- [DocumentBodyStart:ead3446c-6c8e-4df7-8172-b213b88f659b] --&gt;&lt;div class='jive-rendered-content'&gt;&lt;p&gt;This post is the sixth in a series of blog posts about customizing for Clearspace 2.x. The previous posts covered:&lt;/p&gt;&lt;ol&gt;&lt;li level="1" type="ol"&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="http://www.jivesoftware.com/community/blogs/clearspace/2008/06/24/customizations-in-clearspace-2x-part-one/"&gt;Customizations in Clearspace 2.x&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;li level="1" type="ol"&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="http://www.jivesoftware.com/community/blogs/clearspace/2008/06/26/customization-part-2-upgrading-themes-and-ftl-files/"&gt;Upgrading Themes and FTL Files&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt;&lt;li level="1" type="ol"&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="http://www.jivesoftware.com/community/blogs/clearspace/2008/06/30/customization-part-3-widgets"&gt;Widgets in Clearspace 2.x&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;li level="1" type="ol"&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="http://www.jivesoftware.com/community/blogs/clearspace/2008/07/03/customization-part-4-macros"&gt;Macros for Clearspace 2.0&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;li level="1" type="ol"&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="http://www.jivesoftware.com/community/blogs/clearspace/2008/07/07/customization-part-5-web-services"&gt;Web Services&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;As in the Clearspace 1.x series, in Clearspace 2.x versions you can write your own components to manage user information and provide custom authentication. &lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;h3&gt;&lt;span&gt;Upgrading a User Data Provider&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;In version 1 you created a custom user provider by implementing the com.jivesoftware.spi.user.UserProvider interface to interact with your user data source and implementing the com.jivesoftware.base.User interface to represent a user. In version 2, you implement UserProvider and User, but the interfaces have changed a bit. The version 2 model is more streamlined, removing the need to implement the lifecycle methods that the SPI framework requires. Here's a summary of the changes:&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;ul&gt;&lt;li level="1" type="ul"&gt;&lt;p&gt;Because you no longer implement the ServiceProvider interface, you don't implement support for its life cycle methods. Clearspace handles provider life cycle through Spring.&lt;/p&gt;&lt;/li&gt;&lt;li level="1" type="ul"&gt;&lt;p&gt;The com.jivesoftware.base.User interface is read-only (lacks setters) in version 2. Your implementation now provides the interface and logic for updating user information and returning it to Clearspace.&lt;/p&gt;&lt;/li&gt;&lt;li level="1" type="ul"&gt;&lt;p&gt;The User.authenticate method has been removed. Use an authentication provider to authenticate a user.&lt;/p&gt;&lt;/li&gt;&lt;li level="1" type="ul"&gt;&lt;p&gt;The User interface includes several new methods for retrieving information about the user.&lt;/p&gt;&lt;/li&gt;&lt;li level="1" type="ul"&gt;&lt;p&gt;You now connect your custom provider to Clearspace using Spring conventions rather than by setting a Jive property.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here's a high level view of the upgrade steps you'll need to consider.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;ul&gt;&lt;li level="1" type="ul"&gt;&lt;p&gt;Implement the User interface to support whatever setters it needs. You'll also want to implement the is*Supported methods that indicate to Clearspace which user data is supported for setting.&lt;/p&gt;&lt;/li&gt;&lt;li level="1" type="ul"&gt;&lt;p&gt;For UserProvider methods in which your code receives and returns a User instance, you'll need to rewrite a bit to return your own User implementation. In version 1 the UserProvider instance received a UserTemplate with setters. Because you can no longer simply call setters on the User instance you receive (it might not have any), you'll instead copy data from the received instance into an instance of your own implementation and return your own (such as by constructing your instance from the User your code receives). The methods you'll need to change include create(User) and getUser(User).&lt;/p&gt;&lt;/li&gt;&lt;li level="1" type="ul"&gt;&lt;p&gt;Implement UserProvider.supportsUpdate to return true if your data store supports creating or updating users from Clearspace. If you return false from this method, be sure to also throw an UnsupportedOperationException from the create and update methods.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;h3&gt;&lt;span&gt;Upgrading an Authentication Provider&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;Authentication is substantially changed in version 2. For example, you no longer need to pass an AuthToken instance with method calls. Every request is guaranteed to have an authentication context. In version 2, Clearspace uses Acegi security, which is designed to fit well with the Spring framework. If you're implementing your own authentication provider, your components are based on Acegi; in some cases you might be able to use the classes included with Acegi, such as Authentication implementations.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Be sure to read the &lt;a class="jive-link-external-small" href="http://www.acegisecurity.org/guide/springsecurity.html"&gt;Acegi documentation&lt;/a&gt;, which includes information you'll find useful.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;h4&gt;&lt;span&gt;What Your Implementation Should Include&lt;/span&gt;&lt;/h4&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;ul&gt;&lt;li level="1" type="ul"&gt;&lt;p&gt;Implement org.acegisecurity.AuthenticationProvider to provide the service that authenticates users for Clearspace. This interface includes two methods: authenticate(Authentication) and supports(Class). Your supports method is called by Clearspace to determine whether the Authentication approach is supported by your provider. You should return true if the Authentication class it receives is one your authenticate method supports.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!--[CodeBlockStart:2f7ec3fa-5b76-4d81-9f4c-cba13cd3ff61]--&gt;&lt;pre class="jive-pre"&gt;&lt;code class="jive-code"&gt;public boolean supports(Class authentication) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; return authentication == UsernamePasswordAuthenticationToken.class;
}&lt;/code&gt;&lt;/pre&gt;&lt;!--[CodeBlockEnd:2f7ec3fa-5b76-4d81-9f4c-cba13cd3ff61]--&gt;&lt;p&gt;&lt;br/&gt; The authenticate method receives an Authentication instance containing information identifying the user. Your implementation knows how to authenticate the user and should return an Authentication instance that indicates whether the user is authenticated. Here's a simple authenticate method example in which the checkAuth method (not shown) communicates with the data source and returns true if the user is authentic: &lt;br/&gt; &lt;/p&gt;&lt;!--[CodeBlockStart:c4dcb8fd-8d92-49ca-b981-8878d286e5a4]--&gt;&lt;pre class="jive-pre"&gt;&lt;code class="jive-code"&gt;public Authentication authenticate(Authentication authentication) throws AuthenticationException {
&amp;nbsp;&amp;nbsp;&amp;nbsp; UsernamePasswordAuthenticationToken auth = (UsernamePasswordAuthenticationToken) authentication;
&amp;nbsp;&amp;nbsp;&amp;nbsp; String username = String.valueOf(auth.getPrincipal());
&amp;nbsp;&amp;nbsp;&amp;nbsp; String password = String.valueOf(auth.getCredentials());
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(!checkAuth(username, password)){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new BadCredentialsException("Username:" + username + " was not authenticated");
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; return new UsernamePasswordAuthenticationToken(username, password, new GrantedAuthority[]{});
}&lt;/code&gt;&lt;/pre&gt;&lt;!--[CodeBlockEnd:c4dcb8fd-8d92-49ca-b981-8878d286e5a4]--&gt;&lt;p&gt;&lt;br/&gt; &lt;/p&gt;&lt;ul&gt;&lt;li level="1" type="ul"&gt;&lt;p&gt;Implement org.acegisecurity.Authentication to contain details of the authentication request (you can also use an existing class that implements Authentication ). An Authentication class represents the user in the context of a particular authentication approach -- such as basic authentication, LDAP, X.509 certificate, and so on. An instance includes details such as principal (something identifying the user, such as a username) and credentials (such as a password). Your isAuthenticated method should return true if the user is authentic. &lt;br/&gt;&amp;nbsp; &lt;br/&gt; The Authentication class includes a getAuthorities method that is not currently supported by Clearspace. Your implementation should return an empty array: &lt;br/&gt; &lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!--[CodeBlockStart:978a504d-8353-4a9f-9a93-cb30da9712be]--&gt;&lt;pre class="jive-pre"&gt;&lt;code class="jive-code"&gt;public GrantedAuthority[] getAuthorities() {
&amp;nbsp;&amp;nbsp;&amp;nbsp; return new GrantedAuthority[0];
}]&lt;/code&gt;&lt;/pre&gt;&lt;!--[CodeBlockEnd:978a504d-8353-4a9f-9a93-cb30da9712be]--&gt;&lt;p&gt;&lt;br/&gt; &lt;/p&gt;&lt;ul&gt;&lt;li level="1" type="ul"&gt;&lt;p&gt;Connect your authentication provider to Clearspace by adding a Spring configuration XML file to the jiveHome/etc directory.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;!--[CodeBlockStart:0a74b0e1-505e-4445-ab02-95c2bbb65a95]--&gt;&lt;pre class="jive-pre"&gt;&lt;code class="jive-code"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"&amp;gt;
&amp;lt;bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy"&amp;gt;
&amp;lt;property name="filterInvocationDefinitionSource"&amp;gt;
&amp;lt;value&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
&amp;nbsp;&amp;nbsp;&amp;nbsp; PATTERN_TYPE_APACHE_ANT
&amp;nbsp;&amp;nbsp;&amp;nbsp; /upgrade/**=httpSessionContextIntegrationFilter, upgradeAuthenticationFilter, upgradeExceptionTranslationFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; /post-upgrade/**=httpSessionContextIntegrationFilter, postUpgradeAuthenticationFilter, postUpgradeExceptionTranslationFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; /admin/**=httpSessionContextIntegrationFilter, adminAuthenticationFilter, adminExceptionTranslationFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; /rpc/xmlrpc=httpSessionContextIntegrationFilter, basicAuthenticationFilter, wsExceptionTranslator
&amp;nbsp;&amp;nbsp;&amp;nbsp; /rpc/rest/**=httpSessionContextIntegrationFilter, basicAuthenticationFilter, wsExceptionTranslator
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**=httpSessionContextIntegrationFilter, formAuthenticationFilter, rememberMeProcessingFilter, anonymousProcessingFilter, exceptionTranslationFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; .... add your implementation ...
&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;/bean&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;!--[CodeBlockEnd:0a74b0e1-505e-4445-ab02-95c2bbb65a95]--&gt;&lt;p&gt;The following stanza lists the authentication providers that Clearspace tries to use. When trying to authenticate a user, Clearspace tries with each in turn, top to bottom. Each of the beans listed here&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;!--[CodeBlockStart:652f51dc-ae5e-433f-b207-027a1525ccd6]--&gt;&lt;pre class="jive-pre"&gt;&lt;code class="jive-code"&gt;&amp;lt;!-- A list of authentication sources that will be consulted when attempting to
&amp;nbsp;&amp;nbsp;&amp;nbsp; authenticate the user. Each is consulted in order until a provider does
&amp;nbsp;&amp;nbsp;&amp;nbsp; *not* return null. This chains multiple providers together
&amp;nbsp;&amp;nbsp;&amp;nbsp; until one decides it can handle the user. --&amp;gt;
&amp;lt;bean id="authenticationManager" 
&amp;nbsp;&amp;nbsp;&amp;nbsp; class="org.acegisecurity.providers.ProviderManager"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="providers"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;list&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ref bean="jiveLdapAuthenticationProvider"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ref bean="jiveLegacyAuthenticationProvider"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ref bean="daoAuthenticationProvider" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ref bean="rememberMeAuthenticationProvider"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ref bean="anonymousAuthenticationProvider"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/list&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;
&amp;lt;/bean&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;!--[CodeBlockEnd:652f51dc-ae5e-433f-b207-027a1525ccd6]--&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The information above along with more details can be found in the &lt;a class="jive-link-external-small" href="http://www.jivesoftware.com/community/docs/DOC-2060/"&gt;Upgrading Extensions to 2.0 documentation&lt;/a&gt;.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If you are working on authentication for SSO, you might also be interested in reading Fred's post about &lt;a class="jive-link-external-small" href="http://www.jivesoftware.com/community/blogs/clearspace/2008/07/01/quick-sso-on-clearspace-20/"&gt;Quick SSO on Clearspace 2.0&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:ead3446c-6c8e-4df7-8172-b213b88f659b] --&gt;</description>
      <category domain="http://www.jivesoftware.com/jivespace/blogs/jivespace/tags">clearspace</category>
      <category domain="http://www.jivesoftware.com/jivespace/blogs/jivespace/tags">sso</category>
      <category domain="http://www.jivesoftware.com/jivespace/blogs/jivespace/tags">sso</category>
      <category domain="http://www.jivesoftware.com/jivespace/blogs/jivespace/tags">authentication</category>
      <category domain="http://www.jivesoftware.com/jivespace/blogs/jivespace/tags">acegi</category>
      <pubDate>Fri, 11 Jul 2008 21:37:43 GMT</pubDate>
      <author>communities@jivesoftware.com</author>
      <guid>http://www.jivesoftware.com/jivespace/blogs/jivespace/2008/07/11/customization-part-6-custom-authentication-and-user-data-providers</guid>
      <dc:date>2008-07-11T21:37:43Z</dc:date>
      <clearspace:dateToText>1 year, 4 months ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>http://www.jivesoftware.com/jivespace/blogs/jivespace/comment/customization-part-6-custom-authentication-and-user-data-providers</wfw:comment>
      <wfw:commentRss>http://www.jivesoftware.com/jivespace/blogs/jivespace/feeds/comments?blogPost=1550</wfw:commentRss>
    </item>
    <item>
      <title>Quick SSO on Clearspace 2.0</title>
      <link>http://www.jivesoftware.com/jivespace/blogs/jivespace/2008/07/01/quick-sso-on-clearspace-20</link>
      <description>&lt;!-- [DocumentBodyStart:a127c4f5-9f1b-4913-85b8-aa56b8a4beee] --&gt;&lt;div class='jive-rendered-content'&gt;&lt;p&gt;Below is a small filter that I co-authored recently to integrate with Oracle Access Manager (formerly called Oblix). With the release of CS 2.0 we have totally revamped the authentication process and it is now built on spring-security (formerly acegi). Doing this makes it super easy for most of the typical SSO use-cases to be implemented in a reasonable amount of time. &lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here was the use case:&lt;/p&gt;&lt;p&gt;1. User Makes initiial request and is not authenticated yet.&lt;/p&gt;&lt;p&gt;2. Webgate routes user to the corporate login page&lt;/p&gt;&lt;p&gt;3. User supplies auth credentials&lt;/p&gt;&lt;p&gt;4. Webgate authenticates the user&lt;/p&gt;&lt;p&gt;5. Webgate sets an Authentication Cookie that identifies this user to Webgate&lt;/p&gt;&lt;p&gt;6. Webgate adds custom HTTP Headers to a new request to the originally requested resource, in this case clearspace.&lt;/p&gt;&lt;p&gt;7. Clearspace ACEGI Filter chain executes for /*** path, this is where I inserted the OblixSSOFilter right before the form authentication.&lt;/p&gt;&lt;p&gt;8. The Filter executes, grabs the HTTP Header "jwt-dn" and extracts the users DN (the user name).&lt;/p&gt;&lt;p&gt;9. The Filter retrieves the User and creates an Authentication and allows the rest of the filters to execute.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The User is now authenticated. The Default authoprovider ultimatly loads the Users permission etc downstream using the default AuthProvider. &lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here is the code for the filter. The filter is pretty straight forward. It looks at the incoming HttpServletRequest and attempts to retrieve a HTTP Header that was sent along from the webgate authentication form previously visited by the user, as stated above, in this particular scenario I was able to assume authentication would always be done prior to accessing clearspace. &lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;!--[CodeBlockStart:caee8188-7608-48f3-be42-cfbf9c13690f]--&gt;&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt; &lt;font color="navy"&gt;&lt;b&gt;package&lt;/b&gt;&lt;/font&gt; com.jivesoftware.clearspace.sso.oblix;
&amp;nbsp;
&amp;nbsp;
&lt;font color="navy"&gt;&lt;b&gt;import&lt;/b&gt;&lt;/font&gt; com.jivesoftware.community.aaa.AnonymousAuthentication;
&lt;font color="navy"&gt;&lt;b&gt;import&lt;/b&gt;&lt;/font&gt; com.jivesoftware.community.aaa.JiveUserAuthentication;
&lt;font color="navy"&gt;&lt;b&gt;import&lt;/b&gt;&lt;/font&gt; com.jivesoftware.base.*;
&amp;nbsp;
&amp;nbsp;
&lt;font color="navy"&gt;&lt;b&gt;import&lt;/b&gt;&lt;/font&gt; javax.servlet.*;
&lt;font color="navy"&gt;&lt;b&gt;import&lt;/b&gt;&lt;/font&gt; javax.servlet.http.HttpServletRequest;
&lt;font color="navy"&gt;&lt;b&gt;import&lt;/b&gt;&lt;/font&gt; javax.servlet.ServletResponse;
&lt;font color="navy"&gt;&lt;b&gt;import&lt;/b&gt;&lt;/font&gt; javax.servlet.FilterChain;
&lt;font color="navy"&gt;&lt;b&gt;import&lt;/b&gt;&lt;/font&gt; java.io.IOException;
&amp;nbsp;
&lt;font color="navy"&gt;&lt;b&gt;import&lt;/b&gt;&lt;/font&gt; org.acegisecurity.context.SecurityContextHolder;
&lt;font color="navy"&gt;&lt;b&gt;import&lt;/b&gt;&lt;/font&gt; org.acegisecurity.Authentication;
&lt;font color="navy"&gt;&lt;b&gt;import&lt;/b&gt;&lt;/font&gt; org.apache.commons.lang.StringUtils;
&amp;nbsp;
&lt;font color="darkgreen"&gt;/**
 * Created by IntelliJ IDEA.
 * User: fred
 * Date: Jun 11, 2008
 * Time: 12:36:14 PM
 */&lt;/font&gt;
&lt;font color="navy"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;&lt;b&gt;class&lt;/b&gt;&lt;/font&gt; OblixSSOFilter &lt;font color="navy"&gt;&lt;b&gt;implements&lt;/b&gt;&lt;/font&gt; Filter &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;&lt;b&gt;static&lt;/b&gt;&lt;/font&gt; String OAMHEADER = &lt;font color="red"&gt;"jwt-unique"&lt;/font&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;&lt;b&gt;static&lt;/b&gt;&lt;/font&gt; String HEADER_NAME = &lt;font color="red"&gt;"jwt-dn"&lt;/font&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt; UserManager userManager;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="darkgreen"&gt;//possible to use system properties to enable and change the header, for&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="darkgreen"&gt;//now just keep it simple.&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt; String oamHeaderName = HEADER_NAME;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;&lt;b&gt;boolean&lt;/b&gt;&lt;/font&gt; enabled = &lt;font color="navy"&gt;&lt;b&gt;true&lt;/b&gt;&lt;/font&gt;;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; OblixSSOFilter()&lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;super&lt;/b&gt;&lt;/font&gt;();
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;
&amp;nbsp; 
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt; doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) &lt;font color="navy"&gt;&lt;b&gt;throws&lt;/b&gt;&lt;/font&gt; IOException, ServletException &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Authentication authentication;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;(!enabled)&lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filterChain.doFilter(servletRequest,servletResponse);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;&lt;font color="navy"&gt;&lt;b&gt;else&lt;/b&gt;&lt;/font&gt;&lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;try&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Log.debug(&lt;font color="red"&gt;"executing oblix filter"&lt;/font&gt;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HttpServletRequest request = (HttpServletRequest)servletRequest;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String oamHeader = request.getHeader(getOamHeaderName());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;(oamHeader != &lt;font color="navy"&gt;&lt;b&gt;null&lt;/b&gt;&lt;/font&gt;)&lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Log.debug(&lt;font color="red"&gt;"got OAM header: "&lt;/font&gt; + oamHeader);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String userDN = extractUserDN(oamHeader);
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User authenticationTarget = &lt;font color="navy"&gt;&lt;b&gt;null&lt;/b&gt;&lt;/font&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;try&lt;/b&gt;&lt;/font&gt;&lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; authenticationTarget = userManager.getUser(StringUtils.chomp(userDN));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;&lt;font color="navy"&gt;&lt;b&gt;catch&lt;/b&gt;&lt;/font&gt;(UserNotFoundException e)&lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Log.error(&lt;font color="red"&gt;"no user found with username: "&lt;/font&gt; + userDN);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="darkgreen"&gt;//Found an a&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; authentication = &lt;font color="navy"&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt; JiveUserAuthentication(authenticationTarget);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; authentication.setAuthenticated(&lt;font color="navy"&gt;&lt;b&gt;true&lt;/b&gt;&lt;/font&gt;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;&lt;font color="navy"&gt;&lt;b&gt;else&lt;/b&gt;&lt;/font&gt;&lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Log.debug(&lt;font color="red"&gt;"no OAM Header"&lt;/font&gt;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; authentication = &lt;font color="navy"&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt; AnonymousAuthentication();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SecurityContextHolder.getContext().setAuthentication(authentication);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;&lt;font color="navy"&gt;&lt;b&gt;catch&lt;/b&gt;&lt;/font&gt; (Exception e) &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Log.error(&lt;font color="red"&gt;"Exception occured while trying to authenticate OAM response: "&lt;/font&gt; + e.getMessage());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filterChain.doFilter(servletRequest,servletResponse);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt; String extractUserDN(String header)&lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String userName = &lt;font color="navy"&gt;&lt;b&gt;null&lt;/b&gt;&lt;/font&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String[] elements = StringUtils.split(header,&lt;font color="navy"&gt;','&lt;/font&gt;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;for&lt;/b&gt;&lt;/font&gt;(String element: elements)&lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Log.debug(&lt;font color="red"&gt;"processing header: "&lt;/font&gt; + element);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;(element.startsWith(OAMHEADER))&lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String[] uniqueID = StringUtils.split(element,&lt;font color="navy"&gt;'='&lt;/font&gt;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; userName = uniqueID[1];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt;(userName);
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt; destroy()&lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt; setUserManager(UserManager userManager) &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.userManager = userManager;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; AuthenticationProvider getAuthenticationProvider() &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt; authenticationProvider;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt; setAuthenticationProvider(AuthenticationProvider authenticationProvider) &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.authenticationProvider = authenticationProvider;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; String getOamHeaderName() &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt; oamHeaderName;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt; setOamHeaderName(String oamHeaderName) &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.oamHeaderName = oamHeaderName;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;&lt;b&gt;boolean&lt;/b&gt;&lt;/font&gt; isEnabled() &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt; enabled;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt; setEnabled(&lt;font color="navy"&gt;&lt;b&gt;boolean&lt;/b&gt;&lt;/font&gt; enabled) &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.enabled = enabled;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="navy"&gt;}&lt;/font&gt;
&lt;font color="navy"&gt;}&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;!--[CodeBlockEnd:caee8188-7608-48f3-be42-cfbf9c13690f]--&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I simply created a jar containing this one class that I deployed to the WEB-INF\lib directory of a expanded clearspace war file. You can use any IDE or VI and Ant to create the jar, nothing special about it or clearspace specific.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;After I had the jar. I needed to tell clearspace about the filter. Since 2.0 there is a back door that can be utilized to override the default implementation of clearspace managers,DAOs and other spring managed beans, this back door is your jiveHome\etc directoy. Within the jiveHome\etc directory you can copy and modify the various spring context files packaged in the clearspace.jar file found in \WEB\lib. This is done by extracting the appropriate spring context file from the clearspace.jar file found in WEB-INF\lib, make your edits to it and copy it into \jiveHome\etc. In my case the authentication filter stack is configured in spring-securityContext.xml so I extracted that and made the changes listed below:&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;!--[CodeBlockStart:fa4f886a-4ced-44e2-b9eb-003b572b4fe8]--&gt;&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-xml"&gt;
&lt;span class="jive-xml-comment"&gt;&amp;lt;!-- NOTICE THE ADDITION OF oblixSS0Filter --&amp;gt;
&lt;span class="jive-xml-tag"&gt;&amp;lt;bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy"&amp;gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="jive-xml-tag"&gt;&amp;lt;property name="filterInvocationDefinitionSource"&amp;gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="jive-xml-tag"&gt;&amp;lt;value&amp;gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PATTERN_TYPE_APACHE_ANT
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /upgrade/**=httpSessionContextIntegrationFilter, upgradeAuthenticationFilter, upgradeExceptionTranslationFilter,jiveAuthenticationTranslationFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /post-upgrade/**=httpSessionContextIntegrationFilter, postUpgradeAuthenticationFilter, postUpgradeExceptionTranslationFilter,jiveAuthenticationTranslationFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /admin/**=httpSessionContextIntegrationFilter, adminAuthenticationFilter, adminExceptionTranslationFilter,jiveAuthenticationTranslationFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /rpc/xmlrpc=wsRequireSSLFilter, httpSessionContextIntegrationFilter, basicAuthenticationFilter, wsExceptionTranslator, jiveAuthenticationTranslationFilter, wsAccessTypeCheckFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /rpc/rest/**=wsRequireSSLFilter, httpSessionContextIntegrationFilter, basicAuthenticationFilter, wsExceptionTranslator, jiveAuthenticationTranslationFilter, wsAccessTypeCheckFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /rpc/soap/**=wsRequireSSLFilter, httpSessionContextIntegrationFilter, jiveAuthenticationTranslationFilter 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**=httpSessionContextIntegrationFilter, oblixSSoFilter formAuthenticationFilter, rememberMeProcessingFilter, feedBasicAuthenticationFilter, jiveAuthenticationTranslationFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="jive-xml-tag"&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="jive-xml-tag"&gt;&amp;lt;/property&amp;gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="jive-xml-tag"&gt;&amp;lt;/bean&amp;gt;&lt;/span&gt;

&amp;lt;!-- DECLARE THE NEW FILTER --&amp;gt;&lt;/span&gt;
&lt;span class="jive-xml-tag"&gt;&amp;lt;bean id="oblixSSoFilter" class="com.jivesoftware.clearspace.sso.oblix.OblixSSOFilter"&amp;gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="jive-xml-tag"&gt;&amp;lt;property name="userManager" ref="userManager" /&amp;gt;&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="jive-xml-tag"&gt;&amp;lt;/bean&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;!--[CodeBlockEnd:fa4f886a-4ced-44e2-b9eb-003b572b4fe8]--&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;As you can see the stack is configured to protect various resources within clearspace, you can add to this stack as required for your particular case, in my case it was simply a matter of declaring my filter, this allows spring to handle the creation of the object and changing the filter stack for the root path of the application to ensure the oblixSSOFilter fired off prior to formAuthentication. If the oblix filter is able to vouch for the user making the request (via the headers) the filter sets the Authentication on the SecurityContext and life moves forward with an authenticated user, if not, I allow it to fall to the next filter in the stack and the process repeats, with this new framework in place it makes it easy to support multiple authentication sources while still staying on the peripheral edges of the product which will help when it comes time to upgrade. &lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;After you have made the changes, restart your clearspace instance and you should be up and running with your new filter.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Enjoy!.&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:a127c4f5-9f1b-4913-85b8-aa56b8a4beee] --&gt;</description>
      <category domain="http://www.jivesoftware.com/jivespace/blogs/jivespace/tags">code</category>
      <category domain="http://www.jivesoftware.com/jivespace/blogs/jivespace/tags">customization</category>
      <category domain="http://www.jivesoftware.com/jivespace/blogs/jivespace/tags">sso</category>
      <category domain="http://www.jivesoftware.com/jivespace/blogs/jivespace/tags">acegi</category>
      <category domain="http://www.jivesoftware.com/jivespace/blogs/jivespace/tags">2.0</category>
      <category domain="http://www.jivesoftware.com/jivespace/blogs/jivespace/tags">spring-security</category>
      <pubDate>Tue, 01 Jul 2008 21:24:46 GMT</pubDate>
      <author>communities@jivesoftware.com</author>
      <guid>http://www.jivesoftware.com/jivespace/blogs/jivespace/2008/07/01/quick-sso-on-clearspace-20</guid>
      <dc:date>2008-07-01T21:24:46Z</dc:date>
      <clearspace:dateToText>1 year, 4 months ago</clearspace:dateToText>
      <clearspace:replyCount>11</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
      <wfw:comment>http://www.jivesoftware.com/jivespace/blogs/jivespace/comment/quick-sso-on-clearspace-20</wfw:comment>
      <wfw:commentRss>http://www.jivesoftware.com/jivespace/blogs/jivespace/feeds/comments?blogPost=1547</wfw:commentRss>
    </item>
  </channel>
</rss>

