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

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


      DataSource ds = (DataSource) envCtx.lookup(jndikey);
      conn = ds.getConnection();
      return conn;
    } catch (Exception e) {
      logger.log(Level.SEVERE, "DBTokenStore.java : getConnectionUsingJNDI : ", e);
      throw new OAuthException(e,"DBTokenStore.java : getConnectionUsingJNDI caused exeption" );
    }
  }
View Full Code Here


      bos.close();

      byte[] data = bos.toByteArray();
      return data;
    } catch (Exception e) {
      throw new OAuthException(e,"DBTokenStore.java : getConnectionUsingJNDI caused exeption" );
    }
  }
View Full Code Here

    String driver = getJdbcDriverClass();
    try {
      Class.forName(driver).newInstance(); // Load driver
    } catch (Exception ex) {
      logger.log(Level.SEVERE, "loadDBDriver : Could not load driver for class" + driver, ex);
      throw new OAuthException(ex,"DBTokenStore.java : loadDBDriver Could not load driver for class" + driver );
    }
    driverLoaded = true;
  }
View Full Code Here

        }
        // Look for a bean and/or class
        if(StringUtil.isNotEmpty(name)) {
            Object o = Context.get().getBean(name);
            if(!(o instanceof TokenStore)) {
                throw new OAuthException(null,"Invalid OAuth token store implementation {0}",name);
            }
            return (TokenStore)o;
        }
        // Ok, use the default one
        return getDefaultStore();
View Full Code Here

      byte[] keyBytes = null;
      try {
        keyBytes = signingKey.getBytes(Configuration.ENCODING);
      } catch (UnsupportedEncodingException e) {
        throw new OAuthException(e,
            "HMACEncryptionUtility : generateHMACSignature caused UnsupportedEncodingException exception");
      }
      SecretKey secretKey = new SecretKeySpec(keyBytes, "HmacSHA1");
      Mac mac = Mac.getInstance("HmacSHA1");
      mac.init(secretKey);
      byte[] text = null;
      try {
        text = signature_base_string.getBytes(Configuration.ENCODING);
      } catch (UnsupportedEncodingException e) {
        throw new OAuthException(e,
            "HMACEncryptionUtility : generateHMACSignature caused UnsupportedEncodingException exception");
      }
      String signature = new String(Base64.encodeBase64(mac.doFinal(text))).trim();
      return signature;
    } catch (NoSuchAlgorithmException e) {
      throw new OAuthException(e,
          "HMACEncryptionUtility : generateHMACSignature caused NoSuchAlgorithmException exception");
    } catch (InvalidKeyException e) {
      throw new OAuthException(e,
          "HMACEncryptionUtility : generateHMACSignature caused InvalidKeyException exception");
    }
  }
View Full Code Here

    try {
      signatureBaseString.append(method.toUpperCase()).append("&").append(percentEncode(url))
          .append("&").append(URLEncoder.encode(parameterString, "UTF-8"));
    } catch (UnsupportedEncodingException e) {
      throw new OAuthException(e,
          "HMACEncryptionUtility : generateSignatureBaseString caused UnsupportedEncodingException exception");
    }
    return signatureBaseString.toString();
  }
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.