Package net.oauth

Examples of net.oauth.OAuthException


      if (LOG.isLoggable(Level.FINE)) {
        LOG.fine("Signature base string: " + OAuthSignatureMethod.getBaseString(message));
      }
      VALIDATOR.validateMessage(message, accessor);
    } 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) {
      throw new OAuthException("Error validating OAuth request", e);
    } catch (IOException e) {
      throw new OAuthException("Error validating OAuth request", e);
    }
  }
View Full Code Here


  }
 
  public static synchronized void authorizeAccessor(String token)
      throws OAuthException {
    if (token == null) {
      throw new OAuthException("Null token");
    }
    OAuthAccessor accessor = ACCESSORS.remove(token);
    if (accessor == null) {
      throw new OAuthException("Unknown request token");
    }
    accessor.setProperty("authorized", Boolean.TRUE);
    putAccessor(token, accessor);
  }
View Full Code Here

  }
 
  public static OAuthAccessor generateAccessToken(String requestToken)
      throws OAuthException {
    if (requestToken == null) {
      throw new OAuthException("Null token");
    }

    OAuthAccessor accessor = ACCESSORS.remove(requestToken);
    if (accessor == null) {
      throw new OAuthException("Unknown request token");
    }
    if (accessor.getProperty("authorized") == Boolean.FALSE) {
      putAccessor(requestToken, accessor);
      throw new OAuthException("Request token is not authorized");
    }
   
    String consumerKey = (String) accessor.consumer.getProperty("name");

    // Access token is Sha1(consumerKey || current time)
View Full Code Here

      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) {
      throw new OAuthException("Error validating OAuth request", e);
    } catch (IOException e) {
      throw new OAuthException("Error validating OAuth request", e);
    }
  }
View Full Code Here

    try {
      return accessor.newRequestMessage(method, url, parameters);
    } catch (IOException e) {
      throw new RuntimeException(e);
    } catch (URISyntaxException e) {
      throw new OAuthException(e);
    }
  }
View Full Code Here

            record.setUserName(userId);
            record.setAuthorized(Boolean.TRUE);
            strategy.store(record);
           
        } catch (WebloggerException ex) {
            throw new OAuthException("ERROR: setting authorization flag", ex);
        }
    }
View Full Code Here

            record.setRequestToken(null);
            record.setAccessToken(token);
            strategy.store(record);

        } catch (WebloggerException ex) {
            throw new OAuthException("ERROR: generating access token", ex);
        }
    }
View Full Code Here

        record.setConsumerSecret(UUID.randomUUID().toString());

        try {
            strategy.store(record);
        } catch (WebloggerException ex) {
            throw new OAuthException("ERROR storing accessor", ex);
        }
       
        OAuthConsumer consumer = new OAuthConsumer(
            null,
            record.getConsumerKey(),
View Full Code Here

    public OAuthConsumer addConsumer(String consumerKey)
            throws OAuthException, WebloggerException {
        if (getConsumer() == null) {
            return addConsumer(null, consumerKey);
        } else {
            throw new OAuthException("ERROR: cannot have more than one site-wide consumer");
        }
    }
View Full Code Here

            record.setAuthorized((Boolean)accessor.getProperty("authorized"));
        }
        try {
            strategy.store(record);
        } catch (WebloggerException ex) {
            throw new OAuthException("ERROR storing accessor", ex);
        }
    }
View Full Code Here

TOP

Related Classes of net.oauth.OAuthException

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.