Package com.restfb.exception

Examples of com.restfb.exception.FacebookSignedRequestVerificationException


      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);
View Full Code Here


      Mac mac = Mac.getInstance(algorithm);
      mac.init(new SecretKeySpec(toBytes(appSecret), algorithm));
      byte[] payloadSignature = mac.doFinal(toBytes(encodedPayload));
      return Arrays.equals(signature, payloadSignature);
    } catch (Exception e) {
      throw new FacebookSignedRequestVerificationException("Unable to perform signed request verification", e);
    }
  }
View Full Code Here

TOP

Related Classes of com.restfb.exception.FacebookSignedRequestVerificationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.