Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 /**
  * 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;
     }
 }
Exemplo n.º 3
0
        /**
         * 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;
            }
        }
Exemplo n.º 4
0
 public static void requireParameters(OAuthMessage message, string[] names)
 {
     message.requireParameters(names);
 }
Exemplo n.º 5
0
 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;
 }