com.atlassian.seraph.service.rememberme
Class DefaultRememberMeService

java.lang.Object
  extended by com.atlassian.seraph.service.rememberme.DefaultRememberMeService
All Implemented Interfaces:
RememberMeService

public class DefaultRememberMeService
extends Object
implements RememberMeService

This default RememberMeService needs to have a certain SPI implementations into it so that it can function. This is what the application needs to provide. Most of the other default implementations can be used as is.


Constructor Summary
DefaultRememberMeService(RememberMeConfiguration rememberMeConfiguration, RememberMeTokenDao rememberMeTokenDao, RememberMeTokenGenerator rememberMeTokenGenerator)
           
 
Method Summary
 void addRememberMeCookie(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, String authenticatedUsername)
          This can be called to generate and save a remember me cookie with the application and send it back to the client
 String getRememberMeCookieAuthenticatedUsername(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
          This method can be called to try and authenticate a user name from a remember me cookie.
 void removeRememberMeCookie(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
          This will remove any remember me cookie that may have been presented by the client
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRememberMeService

public DefaultRememberMeService(RememberMeConfiguration rememberMeConfiguration,
                                RememberMeTokenDao rememberMeTokenDao,
                                RememberMeTokenGenerator rememberMeTokenGenerator)
Method Detail

getRememberMeCookieAuthenticatedUsername

public String getRememberMeCookieAuthenticatedUsername(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                       javax.servlet.http.HttpServletResponse httpServletResponse)
Description copied from interface: RememberMeService
This method can be called to try and authenticate a user name from a remember me cookie.

If the cookie is not present, its token doe not match anything or it has expired, then null will be returned and any presented remember me cookie in the client will be removed.

Otherwise a user name is returned, indicating that the underlying application knows about the user

Specified by:
getRememberMeCookieAuthenticatedUsername in interface RememberMeService
Parameters:
httpServletRequest - the request in play
httpServletResponse - the response in play
Returns:
a username if its known about and the remember me cookie is valid

addRememberMeCookie

public void addRememberMeCookie(javax.servlet.http.HttpServletRequest httpServletRequest,
                                javax.servlet.http.HttpServletResponse httpServletResponse,
                                String authenticatedUsername)
Description copied from interface: RememberMeService
This can be called to generate and save a remember me cookie with the application and send it back to the client

Specified by:
addRememberMeCookie in interface RememberMeService
Parameters:
httpServletRequest - the request in play
httpServletResponse - the response in play
authenticatedUsername - the name of the user to generate the remember me cookie for

removeRememberMeCookie

public void removeRememberMeCookie(javax.servlet.http.HttpServletRequest httpServletRequest,
                                   javax.servlet.http.HttpServletResponse httpServletResponse)
Description copied from interface: RememberMeService
This will remove any remember me cookie that may have been presented by the client

Specified by:
removeRememberMeCookie in interface RememberMeService
Parameters:
httpServletRequest - the request in play
httpServletResponse - the response in play


Copyright © 2013 Atlassian. All Rights Reserved.