<?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>Jivespace: Message List - Users not being remembered</title>
    <link>http://www.jivesoftware.com/jivespace/community/support?view=discussions</link>
    <description>Most recent forum messages</description>
    <language>en</language>
    <pubDate>Thu, 18 Dec 2008 13:25:40 GMT</pubDate>
    <generator>Jive SBS 3.0.8 (http://jivesoftware.com/products/clearspace/)</generator>
    <dc:date>2008-12-18T13:25:40Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Re: Users not being remembered</title>
      <link>http://www.jivesoftware.com/jivespace/message/152663?tstart=0#152663</link>
      <description>&lt;!-- [DocumentBodyStart:b74ecc2c-8024-42ee-b963-4ee462662537] --&gt;&lt;div class='jive-rendered-content'&gt;&lt;p&gt;Indeed, it is not a one line fixer and would require some testing effort.&amp;#160; I am going to close this case for the time being.&amp;#160; If you have additional questions about how the rememberMeServices works or about implementing this as a provider, feel free to reply to this thread to reopen the case or to open a new case.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;&lt;p&gt;Austen&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:b74ecc2c-8024-42ee-b963-4ee462662537] --&gt;</description>
      <pubDate>Thu, 18 Dec 2008 13:25:40 GMT</pubDate>
      <author>communities@jivesoftware.com</author>
      <guid>http://www.jivesoftware.com/jivespace/message/152663?tstart=0#152663</guid>
      <dc:date>2008-12-18T13:25:40Z</dc:date>
      <clearspace:dateToText>11 months, 1 week ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Users not being remembered</title>
      <link>http://www.jivesoftware.com/jivespace/message/151437?tstart=0#151437</link>
      <description>&lt;!-- [DocumentBodyStart:77d88599-8d16-4ccd-85ef-142da1f23562] --&gt;&lt;div class='jive-rendered-content'&gt;&lt;p&gt;The solutions that you mention above seem non-trivial. Sometime in the future we will be moving to an SSO, It's likely that that will remove the problems we're having with the RememberMeServices. We might have to wait for persisted logins until we finish the new SSO login.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:77d88599-8d16-4ccd-85ef-142da1f23562] --&gt;</description>
      <pubDate>Mon, 15 Dec 2008 17:52:50 GMT</pubDate>
      <author>mrobinson@appcelerator.com</author>
      <guid>http://www.jivesoftware.com/jivespace/message/151437?tstart=0#151437</guid>
      <dc:date>2008-12-15T17:52:50Z</dc:date>
      <clearspace:dateToText>11 months, 1 week ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Users not being remembered</title>
      <link>http://www.jivesoftware.com/jivespace/message/149468?tstart=0#149468</link>
      <description>&lt;!-- [DocumentBodyStart:a2d25c89-f14f-43a2-b409-116e498d72c4] --&gt;&lt;div class='jive-rendered-content'&gt;&lt;p&gt;How are things coming?&amp;#160; Did you decide which route you plan on taking?&amp;#160; Did you have any additional questions regarding my latest post?&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:a2d25c89-f14f-43a2-b409-116e498d72c4] --&gt;</description>
      <pubDate>Tue, 09 Dec 2008 14:34:29 GMT</pubDate>
      <author>communities@jivesoftware.com</author>
      <guid>http://www.jivesoftware.com/jivespace/message/149468?tstart=0#149468</guid>
      <dc:date>2008-12-09T14:34:29Z</dc:date>
      <clearspace:dateToText>11 months, 2 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>2</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Users not being remembered</title>
      <link>http://www.jivesoftware.com/jivespace/message/148490?tstart=0#148490</link>
      <description>&lt;!-- [DocumentBodyStart:13d1b328-6919-44ae-a6ff-4d0ae2b176b5] --&gt;&lt;div class='jive-rendered-content'&gt;&lt;p&gt;Sorry, I must have read over that a little too fast.&amp;#160; I spoke with a colleague on my team who is a bit more experienced with CS 2.5 SSO integrations and he recommended that you implement this as a AuthenticationProvider rather than an authentication filter.&amp;#160; Most SSO integrations do not have the need for the TokenBasedRememberMeServices.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Since you are just going against an external DB for authentication and using the default login page, this would be more suited to a provider.&amp;#160; You would want to override this spring bean and replace the first three providers with a custom rolled one.&amp;#160; The daoAuthenticationProvider would be a good starting reference:&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;!--[CodeBlockStart:e7bd27e7-4bbe-4547-908b-cb7081f51e3b]--&gt;&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-xml"&gt;&lt;span class="jive-xml-comment"&gt;&amp;lt;!-- List of authentication providers used by the authentication manager beans.
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Customized authentication providers can override this bean and re-define
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; this list as needed.--&amp;gt;&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160; &lt;span class="jive-xml-tag"&gt;&amp;lt;bean id="authenticationProviderList" class="org.springframework.beans.factory.config.ListFactoryBean"&amp;gt;&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="jive-xml-tag"&gt;&amp;lt;property name="sourceList"&amp;gt;&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="jive-xml-tag"&gt;&amp;lt;list&amp;gt;&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="jive-xml-tag"&gt;&amp;lt;ref bean="jiveLdapAuthenticationProvider"/&amp;gt;&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="jive-xml-tag"&gt;&amp;lt;ref bean="daoAuthenticationProvider" /&amp;gt;&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="jive-xml-tag"&gt;&amp;lt;ref bean="jiveLegacyAuthenticationProvider"/&amp;gt;&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="jive-xml-tag"&gt;&amp;lt;ref bean="rememberMeAuthenticationProvider"/&amp;gt;&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="jive-xml-tag"&gt;&amp;lt;ref bean="openfireAuthenticationProvider"/&amp;gt;&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="jive-xml-tag"&gt;&amp;lt;/list&amp;gt;&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="jive-xml-tag"&gt;&amp;lt;/property&amp;gt;&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160; &lt;span class="jive-xml-tag"&gt;&amp;lt;/bean&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;!--[CodeBlockEnd:e7bd27e7-4bbe-4547-908b-cb7081f51e3b]--&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If you do decide to stick with the filter, you'll probably have to extend the JiveUserAuthentication to override that method to return a UsernamePasswordCredentials object.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:13d1b328-6919-44ae-a6ff-4d0ae2b176b5] --&gt;</description>
      <pubDate>Fri, 05 Dec 2008 16:54:23 GMT</pubDate>
      <author>communities@jivesoftware.com</author>
      <guid>http://www.jivesoftware.com/jivespace/message/148490?tstart=0#148490</guid>
      <dc:date>2008-12-05T16:54:23Z</dc:date>
      <clearspace:dateToText>11 months, 3 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>3</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Users not being remembered</title>
      <link>http://www.jivesoftware.com/jivespace/message/148445?tstart=0#148445</link>
      <description>&lt;!-- [DocumentBodyStart:063ad9f8-0998-4c98-8217-628f8077a121] --&gt;&lt;div class='jive-rendered-content'&gt;&lt;p&gt;Just to clarify, I'm not actually returning null. It's happening inside Jive code (specifically the JiveUserAuthentication class). This is how the examples showed how to authenticate a user in my code:&lt;/p&gt;&lt;!--[CodeBlockStart:1fe31262-3341-4bcf-83ec-295fc818b2a6]--&gt;&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Authentication authentication = &lt;font color="navy"&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt; JiveUserAuthentication(jiveUser);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; authentication.setAuthenticated(&lt;font color="navy"&gt;&lt;b&gt;true&lt;/b&gt;&lt;/font&gt;);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; context.setAuthentication(authentication);
&lt;/code&gt;&lt;/pre&gt;&lt;!--[CodeBlockEnd:1fe31262-3341-4bcf-83ec-295fc818b2a6]--&gt;&lt;p&gt;The bit in my previous post where getCredentials is returning null is from the Jive JiveUserAuthentication class.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Perhaps I could extend that class, but I'm not sure what the appropriate thing to return instead of null would be.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:063ad9f8-0998-4c98-8217-628f8077a121] --&gt;</description>
      <pubDate>Fri, 05 Dec 2008 15:30:41 GMT</pubDate>
      <author>mrobinson@appcelerator.com</author>
      <guid>http://www.jivesoftware.com/jivespace/message/148445?tstart=0#148445</guid>
      <dc:date>2008-12-05T15:30:41Z</dc:date>
      <clearspace:dateToText>11 months, 3 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Users not being remembered</title>
      <link>http://www.jivesoftware.com/jivespace/message/148414?tstart=0#148414</link>
      <description>&lt;!-- [DocumentBodyStart:e01422cb-30b2-4373-a4de-08b8da54af8e] --&gt;&lt;div class='jive-rendered-content'&gt;&lt;p&gt;Martin,&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Do you need to return null here?&amp;#160; This is required to be non-null for the remember me services, as you have pointed out.&amp;#160; In order to build the cookie, it is necessary to get the credentials.&amp;#160; If your Authentication's principal is an instance of UserDetails, it will retrieve the password from there.&amp;#160; However, credentials must still be a non-null Object for this to work.&amp;#160; Does it create a problem in your code if you do not return null?&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;&lt;p&gt;Austen&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:e01422cb-30b2-4373-a4de-08b8da54af8e] --&gt;</description>
      <pubDate>Fri, 05 Dec 2008 13:38:40 GMT</pubDate>
      <author>communities@jivesoftware.com</author>
      <guid>http://www.jivesoftware.com/jivespace/message/148414?tstart=0#148414</guid>
      <dc:date>2008-12-05T13:38:40Z</dc:date>
      <clearspace:dateToText>11 months, 3 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>5</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Users not being remembered</title>
      <link>http://www.jivesoftware.com/jivespace/message/146990?tstart=0#146990</link>
      <description>&lt;!-- [DocumentBodyStart:0b8c54dc-5c8a-4803-9bd1-2204d32c4c85] --&gt;&lt;div class='jive-rendered-content'&gt;&lt;p&gt;I've run into a problem with your suggestion. In the snippet of code you listed above (in TokenBasedRememberMeServices from the acegi security package) there is:&lt;/p&gt;&lt;!--[CodeBlockStart:0892180e-90f4-41df-a54f-58276f8bad4f]--&gt;&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;&lt;font color="darkgreen"&gt;// Determine username and password, ensuring empty strings&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/font&gt;
Assert.notNull(successfulAuthentication.getPrincipal());
Assert.notNull(successfulAuthentication.getCredentials());
&lt;/code&gt;&lt;/pre&gt;&lt;!--[CodeBlockEnd:0892180e-90f4-41df-a54f-58276f8bad4f]--&gt;&lt;p&gt;Meanwhile in the JiveUserAuthentication class, which is type of Authentication instance I create in my plugin, I find this code:&lt;/p&gt;&lt;!--[CodeBlockStart:4378c614-479f-4f8d-a843-d924f5f790df]--&gt;&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;font color="navy"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; Object getCredentials() &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="navy"&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt; &lt;font color="navy"&gt;&lt;b&gt;null&lt;/b&gt;&lt;/font&gt;;
&amp;#160;&amp;#160;&amp;#160; &lt;font color="navy"&gt;}&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;!--[CodeBlockEnd:4378c614-479f-4f8d-a843-d924f5f790df]--&gt;&lt;p&gt;Unfortunately, the second assertion fails and the loginSuccess method throws an exception.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:0b8c54dc-5c8a-4803-9bd1-2204d32c4c85] --&gt;</description>
      <pubDate>Tue, 02 Dec 2008 19:25:10 GMT</pubDate>
      <author>mrobinson@appcelerator.com</author>
      <guid>http://www.jivesoftware.com/jivespace/message/146990?tstart=0#146990</guid>
      <dc:date>2008-12-02T19:25:10Z</dc:date>
      <clearspace:dateToText>11 months, 3 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>6</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Users not being remembered</title>
      <link>http://www.jivesoftware.com/jivespace/message/145871?tstart=0#145871</link>
      <description>&lt;!-- [DocumentBodyStart:d59f4268-0fdb-4855-90bc-180888fe7109] --&gt;&lt;div class='jive-rendered-content'&gt;&lt;p&gt;When you call the rememberMeServices loginSuccess method, this is saving the cookie for you.&amp;#160; To create the cookie, it extracts the username and password out of the Authentication object.&amp;#160; Here's a copy of that method:&lt;/p&gt;&lt;!--[CodeBlockStart:819691d9-de65-4c15-8ae9-94d824adac78]--&gt;&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-java"&gt;&amp;#160;&amp;#160;&amp;#160; &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; loginSuccess(HttpServletRequest request, HttpServletResponse response,
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Authentication successfulAuthentication) &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="darkgreen"&gt;// Exit if the principal hasn't asked to be remembered&lt;/font&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="navy"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; (!rememberMeRequested(request, parameter)) &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="navy"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; (logger.isDebugEnabled()) &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; logger.debug(&lt;font color="red"&gt;"Did not send remember-me cookie (principal did not set parameter '"&lt;/font&gt; + this.parameter
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; + &lt;font color="red"&gt;"')"&lt;/font&gt;);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="navy"&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt;;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="darkgreen"&gt;// Determine username and password, ensuring empty strings&lt;/font&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Assert.notNull(successfulAuthentication.getPrincipal());
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Assert.notNull(successfulAuthentication.getCredentials());
&amp;nbsp;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; String username = retrieveUserName(successfulAuthentication);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; String password = retrievePassword(successfulAuthentication);
&amp;nbsp;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="darkgreen"&gt;// If unable to find a username and password, just abort as&lt;/font&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="darkgreen"&gt;// TokenBasedRememberMeServices unable to construct a valid token in&lt;/font&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="darkgreen"&gt;// this case&lt;/font&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="navy"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; (!StringUtils.hasLength(username) || !StringUtils.hasLength(password)) &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="navy"&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt;;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;nbsp;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="navy"&gt;&lt;b&gt;long&lt;/b&gt;&lt;/font&gt; expiryTime = System.currentTimeMillis() + (tokenValiditySeconds * 1000);
&amp;nbsp;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="darkgreen"&gt;// construct token to put in cookie; format is:&lt;/font&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="darkgreen"&gt;// username + ":" + expiryTime + ":" + Md5Hex(username + ":" +&lt;/font&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="darkgreen"&gt;// expiryTime + ":" + password + ":" + key)&lt;/font&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; String signatureValue = DigestUtils.md5Hex(username + &lt;font color="red"&gt;":"&lt;/font&gt; + expiryTime + &lt;font color="red"&gt;":"&lt;/font&gt; + password + &lt;font color="red"&gt;":"&lt;/font&gt; + key);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; String tokenValue = username + &lt;font color="red"&gt;":"&lt;/font&gt; + expiryTime + &lt;font color="red"&gt;":"&lt;/font&gt; + signatureValue;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; String tokenValueBase64 = &lt;font color="navy"&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt; String(Base64.encodeBase64(tokenValue.getBytes()));
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; response.addCookie(makeValidCookie(tokenValueBase64, request, tokenValiditySeconds));
&amp;nbsp;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="navy"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; (logger.isDebugEnabled()) &lt;font color="navy"&gt;{&lt;/font&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; logger
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; .debug(&lt;font color="red"&gt;"Added remember-me cookie for user '"&lt;/font&gt; + username + &lt;font color="red"&gt;"', expiry: '"&lt;/font&gt; + &lt;font color="navy"&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt; Date(expiryTime)
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; + &lt;font color="red"&gt;"'"&lt;/font&gt;);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="navy"&gt;}&lt;/font&gt;
&amp;#160;&amp;#160;&amp;#160; &lt;font color="navy"&gt;}&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;!--[CodeBlockEnd:819691d9-de65-4c15-8ae9-94d824adac78]--&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Once this cookie is established, the rememberMeProcessingFilter will attempt to log you in using the rememberMeServices autoLogin method.&amp;#160; Under the covers, this method will load the password for the user and created a hashed cookie to compare to the hashed cookie that is passed along in the request.&amp;#160; If the two match, you are authenticated and auto logged in.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:d59f4268-0fdb-4855-90bc-180888fe7109] --&gt;</description>
      <pubDate>Wed, 26 Nov 2008 13:52:05 GMT</pubDate>
      <author>communities@jivesoftware.com</author>
      <guid>http://www.jivesoftware.com/jivespace/message/145871?tstart=0#145871</guid>
      <dc:date>2008-11-26T13:52:05Z</dc:date>
      <clearspace:dateToText>12 months, 19 hours ago</clearspace:dateToText>
      <clearspace:replyCount>7</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Users not being remembered</title>
      <link>http://www.jivesoftware.com/jivespace/message/145751?tstart=0#145751</link>
      <description>&lt;!-- [DocumentBodyStart:3b1f5b77-8dd4-4ea3-b9a6-d35f03f492f2] --&gt;&lt;div class='jive-rendered-content'&gt;&lt;p&gt;Austen,&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks for the info. We are implementing your suggestions right away. Do you mind clarifying though, what you mean here:&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="jive-quote"&gt;When you do this, you must make sure that the password hash that you store in the cookie is the same as is stored in the DB, otherwise the rememberMeProcessingFilter will fail to authenticate you from the stored cookie.&lt;/div&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;At what point should be putting the password hash into a cookie? This wasn't previously part of our authentication filter and I don't see it happening in the code you just mentioned either. Thanks again.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:3b1f5b77-8dd4-4ea3-b9a6-d35f03f492f2] --&gt;</description>
      <pubDate>Tue, 25 Nov 2008 23:27:24 GMT</pubDate>
      <author>mrobinson@appcelerator.com</author>
      <guid>http://www.jivesoftware.com/jivespace/message/145751?tstart=0#145751</guid>
      <dc:date>2008-11-25T23:27:24Z</dc:date>
      <clearspace:dateToText>12 months, 1 day ago</clearspace:dateToText>
      <clearspace:replyCount>8</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Users not being remembered</title>
      <link>http://www.jivesoftware.com/jivespace/message/145703?tstart=0#145703</link>
      <description>&lt;!-- [DocumentBodyStart:8ade9b06-acb3-47fb-bda5-257292441acf] --&gt;&lt;div class='jive-rendered-content'&gt;&lt;p&gt;Okay, so here is what I found:&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;The remember me bug with Tomcat only affects IE users and is definitely a problem only in Tomcat 6.0.18 and above.&lt;br/&gt;&lt;/li&gt;&lt;li&gt;Your authentication filter needs a small change in order for the remember me to work&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;There are two changes needed to make this work.&amp;#160; First thing that you'll need to do is inject the rememberMeServices into your Filter.&amp;#160; Second, after you have authenticated, you'll need to call the rememberMeServices.loginSuccess(HttpServletRequest, HttpServletResponse, Authentication).&amp;#160; When you do this, you must make sure that the password hash that you store in the cookie is the same as is stored in the DB, otherwise the rememberMeProcessingFilter will fail to authenticate you from the stored cookie.&lt;/p&gt;&lt;p style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Please let me know if you have any questions about this.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:8ade9b06-acb3-47fb-bda5-257292441acf] --&gt;</description>
      <pubDate>Tue, 25 Nov 2008 22:35:22 GMT</pubDate>
      <author>communities@jivesoftware.com</author>
      <guid>http://www.jivesoftware.com/jivespace/message/145703?tstart=0#145703</guid>
      <dc:date>2008-11-25T22:35:22Z</dc:date>
      <clearspace:dateToText>12 months, 1 day ago</clearspace:dateToText>
      <clearspace:replyCount>9</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
  </channel>
</rss>

