com.atlassian.seraph.service.rememberme
Interface RememberMeService

All Known Implementing Classes:
DefaultRememberMeService, NoopRememberMeService

public interface RememberMeService

The RememberMeService is the top level entry point for getting and setting remember me cookies


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
 

Method Detail

getRememberMeCookieAuthenticatedUsername

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.

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

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

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

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

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

Parameters:
httpServletRequest - the request in play
httpServletResponse - the response in play


Copyright © 2013 Atlassian. All Rights Reserved.