Package net.oauth

Examples of net.oauth.SimpleOAuthValidator


  @Provides
  @Singleton
  protected OAuthValidator provideOAuthValidator() {
    // TODO(ljvderijk): This isn't an industrial strength validator, it grows
    // over time. It should be replaced or cleaned out on a regular interval.
    return new SimpleOAuthValidator();
  }
View Full Code Here


    consumer.setProperty(OAuth.OAUTH_SIGNATURE_METHOD, OAuth.HMAC_SHA1);

    OAuthAccessor accessor = new OAuthAccessor(consumer);

    try {
      message.validateMessage(accessor, new SimpleOAuthValidator());
    } catch (OAuthException e) {
      return false;
    }

    return true;
View Full Code Here

    consumer.setProperty(RSA_SHA1.X509_CERTIFICATE, certificate);

    OAuthAccessor accessor = new OAuthAccessor(consumer);

    try {
      message.validateMessage(accessor, new SimpleOAuthValidator());
    } catch (OAuthException e) {
      return false;
    }

    return true;
View Full Code Here

      accessor.tokenSecret = entry.tokenSecret;
      accessor.accessToken = entry.token;
    }

    try {
      message.validateMessage(accessor, new SimpleOAuthValidator());
    } catch (OAuthProblemException e) {
      throw e;
    } catch (OAuthException e) {
      OAuthProblemException ope = new OAuthProblemException(OAuth.Problems.SIGNATURE_INVALID);
      ope.setParameter(OAuth.Problems.OAUTH_PROBLEM_ADVICE, e.getMessage());
View Full Code Here

                + message.getParameter(OAUTH_BODY_HASH));
      }

      OAuthAccessor accessor = consumerData.getAccessor();
      LOG.info("Signature base string: " + OAuthSignatureMethod.getBaseString(message));
      message.validateMessage(accessor, new SimpleOAuthValidator());
    } catch (NoSuchAlgorithmException e) {
      throw new OAuthException("Error validating OAuth request", e);
    } catch (URISyntaxException e) {
      throw new OAuthException("Error validating OAuth request", e);
    } catch (OAuthException e) {
View Full Code Here

    // Construct validator arguments.
    OAuthConsumer consumer = new OAuthConsumer(null, consumerKey, consumerSecret, null);
    OAuthAccessor accessor = new OAuthAccessor(consumer);
    LOG.info("Signature base string: " + OAuthSignatureMethod.getBaseString(message));
    message.validateMessage(accessor, new SimpleOAuthValidator());
  }
View Full Code Here

      OAuthMessage message = new OAuthMessage(request.getMethod(),
          request.getRequestURL().toString(), getRequestParameters(request));

      OAuthAccessor accessor = new OAuthAccessor(consumer);

      SimpleOAuthValidator validator = new SimpleOAuthValidator();
      validator.validateMessage(message, accessor);
      return true;
    } catch (OAuthProblemException ope) {
      log.warning(OAuthServlet.htmlEncode(ope.getProblem()));
      log.warning(ope.toString());
    } catch (OAuthException e) {
View Full Code Here

  private final OAuthValidator validator;

  @Inject
  public OAuthValidatorProvider(@Named("shindig.oauth.validator-max-timestamp-age-ms")
                                  long maxTimestampAgeMsec) {
    validator = new SimpleOAuthValidator(maxTimestampAgeMsec, Double.parseDouble(OAuth.VERSION_1_0));
  }
View Full Code Here

            {
                throw new UnknownAcHostException(consumerKey);
            }

            host.setProperty(RSA_SHA1.PUBLIC_KEY, publicKey);
            message.validateMessage(new OAuthAccessor(host), new SimpleOAuthValidator());

            return consumerKey;
        }
        catch (OAuthProblemException e)
        {
View Full Code Here

          platformRequestWrapper.getRequestURL().toString(),
          getRequestParameters(platformRequestWrapper));

      OAuthAccessor accessor = new OAuthAccessor(consumer);

      SimpleOAuthValidator validator = new SimpleOAuthValidator();
      validator.validateMessage(message, accessor);
      return true;
    } catch (OAuthProblemException ope) {

      log.warning(ope.toString());
    } catch (IOException e) {
View Full Code Here

TOP

Related Classes of net.oauth.SimpleOAuthValidator

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.