Package com.ibm.sbt.security.authentication.oauth

Examples of com.ibm.sbt.security.authentication.oauth.OAuthException


      } finally {
        StreamUtil.close(reader);
      }

    } catch (Exception e) {
      throw new OAuthException(e, "Internal error - getRequestToken failed Exception: ");
    }
    if (responseCode != HttpStatus.SC_OK) {
      String exceptionDetail = buildErrorMessage(responseCode, responseBody);
      if (StringUtil.isNotEmpty(exceptionDetail)) {
        throw new OAuthException(null,
            "HMACOAuth1Handler.java : getRequestTokenFromServer failed." + exceptionDetail);
      }
    } else {
      /*
       * The Response from Twitter contains OAuth request token, OAuth request token secret, and a
View Full Code Here


      } finally {
        StreamUtil.close(reader);
      }

    } catch (Exception e) {
      throw new OAuthException(e, "Internal error - getAccessToken failed Exception: ");
    }
    if (responseCode != HttpStatus.SC_OK) {
      String exceptionDetail = buildErrorMessage(responseCode, responseBody);
      if (exceptionDetail != null) {
        throw new OAuthException(null,
            "HMACOAuth1Handler.java : getAccessTokenFromServer failed. " + exceptionDetail);
      }
    } else {
      /*
       * Response from twitter contains Access Token, Access Token Secret, User Id and Screen Name of
View Full Code Here

    try {
      // generate the complete URL first
      signature = HMACEncryptionUtility.generateHMACSignature(url, method, consumerSecret, tokenSecret,
          treeMap);
    } catch (Exception e) {
      throw new OAuthException(e, "createAuthorizationHeader failed with Exception");
    }

    StringBuilder headerStr = new StringBuilder();
    headerStr.append("OAuth ").append(Configuration.CONSUMER_KEY).append("=\"").append(consumerKey)
        .append("\"");
    headerStr.append(",").append(Configuration.NONCE).append("=\"").append(nonce).append("\"");
    try {
      headerStr.append(",").append(Configuration.SIGNATURE).append("=\"")
          .append(URLEncoder.encode(signature, "UTF-8")).append("\"");
    } catch (UnsupportedEncodingException e1) {
      throw new OAuthException(e1,
          "createAuthorizationHeader failed with UnsupportedEncodingException");
    }
    headerStr.append(",").append(Configuration.SIGNATURE_METHOD).append("=\"")
        .append(getSignatureMethod()).append("\"");
    headerStr.append(",").append(Configuration.TIMESTAMP).append("=\"").append(timeStamp).append("\"");
View Full Code Here

      }
      return (ConsumerToken) token;

    } catch (SQLException e) {
      logger.log(Level.SEVERE, "getAppToken : ", e);
      throw new OAuthException(e, "DBTokenStore.java : getAppToken caused a SQLException");
    }
  }
View Full Code Here

        connection.close();
      }

    } catch (SQLException e) {
      logger.log(Level.SEVERE, "setAppToken : ", e);
      throw new OAuthException(e, "DBTokenStore.java : setAppToken caused a SQLException");
    }
  }
View Full Code Here

      }
      return (AccessToken) token;

    } catch (SQLException e) {
      e.printStackTrace();
      throw new OAuthException(e, "DBTokenStore.java : getConsumerToken caused a SQLException");
    }
  }
View Full Code Here

      } finally {
        connection.close();
      }
    } catch (SQLException e) {
      logger.log(Level.SEVERE, "setConsumerToken : ", e);
      throw new OAuthException(e, "DBTokenStore.java : setConsumerToken caused a SQLException");
    }
  }
View Full Code Here

        connection.close();
      }

    } catch (SQLException e) {
      logger.log(Level.SEVERE, "deleteConsumerToken : ", e);
      throw new OAuthException(e, "DBTokenStore.java : deleteConsumerToken caused a SQLException");
    }
  }
View Full Code Here

      if (buf != null) {
          Object deSerializedObject = deSerializeObject(buf);
          return deSerializedObject;
        }
    } catch (Exception e) {
      throw new OAuthException(e);
    }
    return null;
  }
View Full Code Here

          objectIn = new ObjectInputStream(new ByteArrayInputStream(tokendata));
          Object deSerializedObject = objectIn.readObject();
          return deSerializedObject;
        }
    } catch (Exception e) {
      throw new OAuthException(e);
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.security.authentication.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.