org.springframework.extensions.surf.site
Class AuthenticationUtil

java.lang.Object
  extended by org.springframework.extensions.surf.site.AuthenticationUtil

public class AuthenticationUtil
extends Object

Author:
muzquiano, kevinr

Constructor Summary
AuthenticationUtil()
           
 
Method Summary
static void clearUserContext(javax.servlet.http.HttpServletRequest request)
           
static javax.servlet.http.Cookie getLastLoginCookie(javax.servlet.http.HttpServletRequest request)
          Helper to return cookie that saves the last login time for the current user.
static String getUserId(javax.servlet.http.HttpServletRequest request)
           
static javax.servlet.http.Cookie getUsernameCookie(javax.servlet.http.HttpServletRequest request)
          Helper to return cookie that saves the last login time for the current user.
static boolean isAuthenticated(javax.servlet.http.HttpServletRequest request)
           
static boolean isExternalAuthentication(javax.servlet.http.HttpServletRequest request)
           
static boolean isGuest(String userId)
           
static void login(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String userId)
           
static void login(javax.servlet.http.HttpServletRequest request, String userId)
           
static void logout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationUtil

public AuthenticationUtil()
Method Detail

logout

public static void logout(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response)

login

public static void login(javax.servlet.http.HttpServletRequest request,
                         String userId)

login

public static void login(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response,
                         String userId)

clearUserContext

public static void clearUserContext(javax.servlet.http.HttpServletRequest request)

isAuthenticated

public static boolean isAuthenticated(javax.servlet.http.HttpServletRequest request)

isGuest

public static boolean isGuest(String userId)

isExternalAuthentication

public static boolean isExternalAuthentication(javax.servlet.http.HttpServletRequest request)

getUserId

public static String getUserId(javax.servlet.http.HttpServletRequest request)

getLastLoginCookie

public static javax.servlet.http.Cookie getLastLoginCookie(javax.servlet.http.HttpServletRequest request)
Helper to return cookie that saves the last login time for the current user.

Parameters:
httpRequest -
Returns:
Cookie if found or null if not present

getUsernameCookie

public static javax.servlet.http.Cookie getUsernameCookie(javax.servlet.http.HttpServletRequest request)
Helper to return cookie that saves the last login time for the current user.

Parameters:
httpRequest -
Returns:
Cookie if found or null if not present


Copyright © 2009 SpringSource, Inc. All Rights Reserved.