org.codehaus.groovy.grails.plugins.springsecurity.facebook
Class FacebookAuthenticationProcessingFilter

java.lang.Object
  extended by org.springframework.security.ui.SpringSecurityFilter
      extended by org.springframework.security.ui.AbstractProcessingFilter
          extended by org.codehaus.groovy.grails.plugins.springsecurity.facebook.FacebookAuthenticationProcessingFilter
All Implemented Interfaces:
javax.servlet.Filter, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationEventPublisherAware, org.springframework.context.MessageSourceAware, org.springframework.core.Ordered

public class FacebookAuthenticationProcessingFilter
extends org.springframework.security.ui.AbstractProcessingFilter

Intercepts j_spring_facebook_security_check to trigger Facebook login.

Author:
Burt Beckwith

Field Summary
 
Fields inherited from class org.springframework.security.ui.AbstractProcessingFilter
authenticationDetailsSource, eventPublisher, messages, SPRING_SECURITY_LAST_EXCEPTION_KEY, SPRING_SECURITY_SAVED_REQUEST_KEY
 
Fields inherited from class org.springframework.security.ui.SpringSecurityFilter
logger
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
FacebookAuthenticationProcessingFilter()
           
 
Method Summary
 void afterPropertiesSet()
          
 org.springframework.security.Authentication attemptAuthentication(javax.servlet.http.HttpServletRequest request)
          
protected  FacebookAuthenticationToken createToken(String authToken, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String apiKey, String secretKey)
          Build an authentication from a login auth_token.
protected  String determineFailureUrl(javax.servlet.http.HttpServletRequest request, org.springframework.security.AuthenticationException failed)
          
 String getDefaultFilterProcessesUrl()
          
 int getOrder()
          
 void setApiKey(String key)
          Dependency injection for the API key.
 void setAuthenticationUrlRoot(String authenticationUrlRoot)
          Dependency injection for the Facebook auth url root.
 void setSecretKey(String key)
          Dependency injection for the secret key.
 
Methods inherited from class org.springframework.security.ui.AbstractProcessingFilter
determineTargetUrl, doFilterHttp, getAllowSessionCreation, getAuthenticationDetailsSource, getAuthenticationFailureUrl, getAuthenticationManager, getDefaultTargetUrl, getFilterProcessesUrl, getRememberMeServices, getTargetUrlResolver, obtainFullSavedRequestUrl, onPreAuthentication, onSuccessfulAuthentication, onUnsuccessfulAuthentication, requiresAuthentication, sendRedirect, setAllowSessionCreation, setAlwaysUseDefaultTargetUrl, setApplicationEventPublisher, setAuthenticationDetailsSource, setAuthenticationFailureUrl, setAuthenticationManager, setContinueChainBeforeSuccessfulAuthentication, setDefaultTargetUrl, setExceptionMappings, setFilterProcessesUrl, setInvalidateSessionOnSuccessfulAuthentication, setMessageSource, setMigrateInvalidatedSessionAttributes, setRememberMeServices, setServerSideRedirect, setSessionRegistry, setTargetUrlResolver, setUseRelativeContext, successfulAuthentication, unsuccessfulAuthentication
 
Methods inherited from class org.springframework.security.ui.SpringSecurityFilter
destroy, doFilter, init, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FacebookAuthenticationProcessingFilter

public FacebookAuthenticationProcessingFilter()
Method Detail

attemptAuthentication

public org.springframework.security.Authentication attemptAuthentication(javax.servlet.http.HttpServletRequest request)
                                                                  throws org.springframework.security.AuthenticationException

Specified by:
attemptAuthentication in class org.springframework.security.ui.AbstractProcessingFilter
Throws:
org.springframework.security.AuthenticationException
See Also:
AbstractProcessingFilter.attemptAuthentication( javax.servlet.http.HttpServletRequest)

createToken

protected FacebookAuthenticationToken createToken(String authToken,
                                                  javax.servlet.http.HttpServletRequest request,
                                                  javax.servlet.http.HttpServletResponse response,
                                                  String apiKey,
                                                  String secretKey)
Build an authentication from a login auth_token.

Parameters:
authToken - the auth_token
request - the http request
response - the http response
apiKey - the API key
secretKey - the secret key
Returns:
the auth token

determineFailureUrl

protected String determineFailureUrl(javax.servlet.http.HttpServletRequest request,
                                     org.springframework.security.AuthenticationException failed)

Overrides:
determineFailureUrl in class org.springframework.security.ui.AbstractProcessingFilter
See Also:
AbstractProcessingFilter.determineFailureUrl( javax.servlet.http.HttpServletRequest, org.springframework.security.AuthenticationException)

getDefaultFilterProcessesUrl

public String getDefaultFilterProcessesUrl()

Specified by:
getDefaultFilterProcessesUrl in class org.springframework.security.ui.AbstractProcessingFilter
See Also:
AbstractProcessingFilter.getDefaultFilterProcessesUrl()

getOrder

public int getOrder()

See Also:
Ordered.getOrder()

setApiKey

public void setApiKey(String key)
Dependency injection for the API key.

Parameters:
key - the key

setSecretKey

public void setSecretKey(String key)
Dependency injection for the secret key.

Parameters:
key - the key

setAuthenticationUrlRoot

public void setAuthenticationUrlRoot(String authenticationUrlRoot)
Dependency injection for the Facebook auth url root.

Parameters:
authenticationUrlRoot - the url root

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Overrides:
afterPropertiesSet in class org.springframework.security.ui.AbstractProcessingFilter
Throws:
Exception
See Also:
AbstractProcessingFilter.afterPropertiesSet()