org.springframework.social.facebook.web
Class SignedRequestDecoder
java.lang.Object
org.springframework.social.facebook.web.SignedRequestDecoder
public class SignedRequestDecoder
- extends Object
Utility class for extracting the payload of a signed request sent by Facebook.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SignedRequestDecoder
public SignedRequestDecoder(String secret)
- Parameters:
secret
- the application secret used in creating and verifying the signature of the signed request.
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