org.springframework.social.facebook.web
Class SignedRequestDecoder

java.lang.Object
  extended by org.springframework.social.facebook.web.SignedRequestDecoder

public class SignedRequestDecoder
extends Object

Utility class for extracting the payload of a signed request sent by Facebook.


Constructor Summary
SignedRequestDecoder(String secret)
           
 
Method Summary
 Map<String,?> decodeSignedRequest(String signedRequest)
          Decodes a signed request, returning the payload of the signed request as a Map
<T> T
decodeSignedRequest(String signedRequest, Class<T> type)
          Decodes a signed request, returning the payload of the signed request as a specified type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignedRequestDecoder

public SignedRequestDecoder(String secret)
Parameters:
secret - the application secret used in creating and verifying the signature of the signed request.
Method Detail

decodeSignedRequest

public Map<String,?> decodeSignedRequest(String signedRequest)
                                  throws SignedRequestException
Decodes a signed request, returning the payload of the signed request as a Map

Parameters:
signedRequest - the value of the signed_request parameter sent by Facebook.
Returns:
the payload of the signed request as a Map
Throws:
SignedRequestException

decodeSignedRequest

public <T> T decodeSignedRequest(String signedRequest,
                                 Class<T> type)
                      throws SignedRequestException
Decodes a signed request, returning the payload of the signed request as a specified type.

Parameters:
signedRequest - the value of the signed_request parameter sent by Facebook.
type - the type to bind the signed_request to.
Returns:
the payload of the signed request as an object
Throws:
SignedRequestException