Package net.oauth

Examples of net.oauth.SimpleOAuthValidator


  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


    OAuthServiceProvider provider = new OAuthServiceProvider(null, null, null);
    OAuthConsumer consumer = new OAuthConsumer(null, appUrl, sharedSecret, provider);
    OAuthAccessor accessor = new OAuthAccessor(consumer);

    SimpleOAuthValidator validator = new SimpleOAuthValidator();
    try {
      validator.validateMessage(message, accessor);
    } catch (OAuthException e) {
      return false;
    } catch (IOException e) {
      return false;
    } catch (URISyntaxException e) {
View Full Code Here

  // Assumes data is all loaded
  public void validateRequest(String oauth_consumer_key, String oauth_secret, HttpServletRequest request)
  {
    valid = false;
    OAuthMessage oam = OAuthServlet.getMessage(request, null);
    OAuthValidator oav = new SimpleOAuthValidator();
    OAuthConsumer cons = new OAuthConsumer("about:blank#OAuth+CallBack+NotUsed",
        oauth_consumer_key, oauth_secret, null);

    OAuthAccessor acc = new OAuthAccessor(cons);

    try {
      base_string = OAuthSignatureMethod.getBaseString(oam);
    } catch (Exception e) {
      base_string = null;
    }

    try {
      oav.validateMessage(oam,acc);
    } catch(Exception e) {
      errorMessage = "Launch fails OAuth validation: "+e.getMessage();
      return;
    }
    valid = true;
View Full Code Here

  // Assumes data is all loaded
  public void validateRequest(String oauth_consumer_key, String oauth_secret, HttpServletRequest request)
  {
    valid = false;
    OAuthMessage oam = OAuthServlet.getMessage(request, null);
    OAuthValidator oav = new SimpleOAuthValidator();
    OAuthConsumer cons = new OAuthConsumer("about:blank#OAuth+CallBack+NotUsed",
        oauth_consumer_key, oauth_secret, null);

    OAuthAccessor acc = new OAuthAccessor(cons);

    try {
      base_string = OAuthSignatureMethod.getBaseString(oam);
    } catch (Exception e) {
      base_string = null;
    }

    try {
      oav.validateMessage(oam,acc);
    } catch(Exception e) {
      errorMessage = "Launch fails OAuth validation: "+e.getMessage();
      return;
    }
    valid = true;
View Full Code Here

      accessor.tokenSecret = entry.getTokenSecret();
      accessor.accessToken = entry.getToken();
    }

    try {
      OAuthValidator validator = new SimpleOAuthValidator();
      validator.validateMessage(message, accessor);
    } 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

   * @param keyManager The key manager instance to be used
   */
  private void initializeFilter(KeyManager keyManager) {
    this.keyManager = keyManager;
    provider = new OAuthServiceProvider(null, null, null);
    validator = new SimpleOAuthValidator();
    logger.info("Initialized OAuth filter with key manager: "
        + keyManager.getClass().getName());
  }
View Full Code Here

  @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

            {
                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

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.