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

java.lang.Object
  extended by org.springframework.security.providers.AbstractAuthenticationToken
      extended by org.codehaus.groovy.grails.plugins.springsecurity.facebook.FacebookAuthenticationToken
All Implemented Interfaces:
Serializable, Principal, org.springframework.security.Authentication

public class FacebookAuthenticationToken
extends org.springframework.security.providers.AbstractAuthenticationToken

Authentication token with Facebook-specific extra information.

Author:
Burt Beckwith
See Also:
Serialized Form

Nested Class Summary
static class FacebookAuthenticationToken.Status
          Token type.
 
Constructor Summary
FacebookAuthenticationToken(FacebookAuthenticationToken.Status status, String errorMessage)
          Create a failure token.
FacebookAuthenticationToken(org.springframework.security.GrantedAuthority[] authorities, long userId, String sessionKey)
          Created by the OpenIDAuthenticationProvider on successful authentication.
FacebookAuthenticationToken(long userId, String sessionKey)
          Created by FacebookAuthenticationProcessingFilter from Facebook login info, but before loading roles.
 
Method Summary
 Object getCredentials()
          
 String getErrorMessage()
          Get the error message (if status is error).
 Object getPrincipal()
          
 String getSessionKey()
          The login session key.
 FacebookAuthenticationToken.Status getStatus()
          The status.
 long getUserId()
          The Facebook UID.
 
Methods inherited from class org.springframework.security.providers.AbstractAuthenticationToken
equals, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FacebookAuthenticationToken

public FacebookAuthenticationToken(org.springframework.security.GrantedAuthority[] authorities,
                                   long userId,
                                   String sessionKey)
Created by the OpenIDAuthenticationProvider on successful authentication.

Parameters:
authorities - roles
userId -
sessionKey -

FacebookAuthenticationToken

public FacebookAuthenticationToken(long userId,
                                   String sessionKey)
Created by FacebookAuthenticationProcessingFilter from Facebook login info, but before loading roles.

Parameters:
userId - the UID
sessionKey - the session key

FacebookAuthenticationToken

public FacebookAuthenticationToken(FacebookAuthenticationToken.Status status,
                                   String errorMessage)
Create a failure token.

Parameters:
status - a non-success token
errorMessage - the error message
Method Detail

getCredentials

public Object getCredentials()

See Also:
Authentication.getCredentials()

getPrincipal

public Object getPrincipal()

See Also:
Authentication.getPrincipal()

getUserId

public long getUserId()
The Facebook UID.

Returns:
the uid

getStatus

public FacebookAuthenticationToken.Status getStatus()
The status.

Returns:
the status

getSessionKey

public String getSessionKey()
The login session key.

Returns:
the key

getErrorMessage

public String getErrorMessage()
Get the error message (if status is error).

Returns:
the message