public static OAuthSignatureMethod newSigner(OAuthMessage message, OAuthAccessor accessor) { message.requireParameters(new[] { OAuth.OAUTH_SIGNATURE_METHOD }); OAuthSignatureMethod signer = newMethod(message.getSignatureMethod(), accessor); signer.setTokenSecret(accessor.TokenSecret); return(signer); }
/** * Check whether the message has a valid signature. * @throws URISyntaxException * * @throws OAuthProblemException * the signature is invalid */ public void validate(OAuthMessage message) { message.requireParameters(new[] { "oauth_signature" }); String signature = message.getSignature(); String baseString = getBaseString(message); if (!isValid(signature, baseString)) { OAuthProblemException problem = new OAuthProblemException( "signature_invalid"); problem.setParameter("oauth_signature", signature); problem.setParameter("oauth_signature_base_string", baseString); problem.setParameter("oauth_signature_method", message .getSignatureMethod()); throw problem; } }
public static void requireParameters(OAuthMessage message, string[] names) { message.requireParameters(names); }
public static OAuthSignatureMethod newSigner(OAuthMessage message, OAuthAccessor accessor) { message.requireParameters(new[] { OAuth.OAUTH_SIGNATURE_METHOD }); OAuthSignatureMethod signer = newMethod(message.getSignatureMethod(), accessor); signer.setTokenSecret(accessor.TokenSecret); return signer; }