throw new FacebookSignedRequestParsingException("Unable to detect algorithm used for signed request");
String algorithm = payloadObject.getString("algorithm");
if (!verifySignedRequest(appSecret, algorithm, encodedPayload, signature))
throw new FacebookSignedRequestVerificationException(
"Signed request verification failed. Are you sure the request was made for the app identified by the app secret you provided?");
// Marshal to the user's preferred type.
// If the user asked for a JsonObject, send back the one we already parsed.
return objectType.equals(JsonObject.class) ? (T) payloadObject : getJsonMapper().toJavaObject(payload, objectType);