nl.surfnet.coin.portal.interceptor
Class LoginInterceptor

java.lang.Object
  extended by org.springframework.web.servlet.handler.HandlerInterceptorAdapter
      extended by nl.surfnet.coin.portal.interceptor.LoginInterceptor
All Implemented Interfaces:
org.springframework.web.servlet.HandlerInterceptor
Direct Known Subclasses:
MockLoginInterceptor

public class LoginInterceptor
extends org.springframework.web.servlet.handler.HandlerInterceptorAdapter

Intercepts calls to controllers to handle Single Sign On details from Shibboleth and sets a Person object on the session when the user is logged in.


Field Summary
static String INVITEES
           
static String PERSON_SESSION_KEY
           
static String USER_STATUS_SESSION_KEY
           
 
Constructor Summary
LoginInterceptor()
           
 
Method Summary
protected  CoinEnvironment getCoinEnvironment()
           
protected  String getRemoteUser(javax.servlet.http.HttpServletRequest request)
          Hook for subclasses to override the shibboleth default behaviour
protected  String getUserStatus(javax.servlet.http.HttpServletRequest request)
          Hook for subclasses to override the shibboleth default behaviour
 boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler)
           
 void setCoinEnvironment(CoinEnvironment coinEnvironment)
           
 void setErrorMessageMailer(nl.surfnet.coin.shared.service.ErrorMessageMailer errorMessageMailer)
           
 void setPersonService(nl.surfnet.coin.opensocial.service.PersonService personService)
           
 
Methods inherited from class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
afterCompletion, postHandle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERSON_SESSION_KEY

public static final String PERSON_SESSION_KEY
See Also:
Constant Field Values

USER_STATUS_SESSION_KEY

public static final String USER_STATUS_SESSION_KEY
See Also:
Constant Field Values

INVITEES

public static final String INVITEES
See Also:
Constant Field Values
Constructor Detail

LoginInterceptor

public LoginInterceptor()
Method Detail

preHandle

public boolean preHandle(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response,
                         Object handler)
                  throws Exception
Specified by:
preHandle in interface org.springframework.web.servlet.HandlerInterceptor
Overrides:
preHandle in class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
Throws:
Exception

getRemoteUser

protected String getRemoteUser(javax.servlet.http.HttpServletRequest request)
Hook for subclasses to override the shibboleth default behaviour

Parameters:
request - the httpRequest
Returns:
the String of the logged in user

getUserStatus

protected String getUserStatus(javax.servlet.http.HttpServletRequest request)
Hook for subclasses to override the shibboleth default behaviour

Parameters:
request - the httpRequest
Returns:
the String of the user status

setPersonService

public void setPersonService(nl.surfnet.coin.opensocial.service.PersonService personService)
Parameters:
personService - the personService to set

setCoinEnvironment

public void setCoinEnvironment(CoinEnvironment coinEnvironment)
Parameters:
coinEnvironment - the coinEnvironment to set

getCoinEnvironment

protected CoinEnvironment getCoinEnvironment()
Returns:
the coinEnvironment

setErrorMessageMailer

public void setErrorMessageMailer(nl.surfnet.coin.shared.service.ErrorMessageMailer errorMessageMailer)


Copyright © 2009-2012 SURFnet bv, The Netherlands. All Rights Reserved.