Package org.brickred.socialauth.exception

Examples of org.brickred.socialauth.exception.SocialAuthException


    if (fpath != null) {
      fpath = fpath.replaceAll("/", String.valueOf(File.separatorChar));
      file = new File(filePath + File.separatorChar
          + accessGrant.getProviderId() + "_accessGrant_file.txt");
    } else {
      throw new SocialAuthException(
          "File location is not given to store access grant file.");
    }
    LOG.debug("Persisting access grant on :: " + file.getAbsolutePath());
    file.createNewFile();
    PrintWriter out = new PrintWriter(file);
View Full Code Here


    if (accessGrant != null) {
      LOG.debug("Obtaining user profile");
      return getProfile();
    } else {
      throw new SocialAuthException("Access token not found");
    }
  }
View Full Code Here

    try {
      Response response = authenticationStrategy.executeFeed(PROFILE_URL);
      presp = response.getResponseBodyAsString(Constants.ENCODING);
    } catch (Exception e) {
      throw new SocialAuthException("Error while getting profile from "
          + PROFILE_URL, e);
    }
    try {
      LOG.debug("User Profile : " + presp);
      JSONObject resp = new JSONObject(presp);
View Full Code Here

   */

  @Override
  public Response updateStatus(final String msg) throws Exception {
    LOG.warn("WARNING: Not implemented for GooglePlus");
    throw new SocialAuthException(
        "Update Status is not implemented for GooglePlus");
  }
View Full Code Here

  @Override
  public List<Contact> getContactList() throws Exception {
    LOG.info("Fetching contacts from " + CONTACTS_FEED_URL);
    if (Permission.AUTHENTICATE_ONLY.equals(this.scope)) {
      throw new SocialAuthException(
          "You have not set Permission to get contacts.");
    }
    Response serviceResponse = null;
    try {
      Map<String, String> map = new HashMap<String, String>();
      map.put("Authorization", "Bearer " + getAccessGrant().getKey());
      serviceResponse = authenticationStrategy.executeFeed(
          CONTACTS_FEED_URL, null, null, map, null);
    } catch (Exception ie) {
      throw new SocialAuthException(
          "Failed to retrieve the contacts from " + CONTACTS_FEED_URL,
          ie);
    }
    List<Contact> plist = new ArrayList<Contact>();
    Element root;
View Full Code Here

    Response response = null;
    try {
      response = authenticationStrategy.executeFeed(url, methodType,
          params, headerParams, body);
    } catch (Exception e) {
      throw new SocialAuthException(
          "Error while making request to URL : " + url, e);
    }
    return response;
  }
View Full Code Here

  @Override
  public Response uploadImage(final String message, final String fileName,
      final InputStream inputStream) throws Exception {
    LOG.warn("WARNING: Not implemented for GooglePlus");
    throw new SocialAuthException(
        "Upload Image is not implemented for GooglePlus");
  }
View Full Code Here

      url = authenticationStrategy.getLoginRedirectURL(successUrl);

    } catch (SocialAuthException ex) {
      String msg = ex.getMessage()
          + "OR you have not set any scope while registering your application. You will have to select atlest read public profile scope while registering your application";
      throw new SocialAuthException(msg, ex);
    }
    return url;
  }
View Full Code Here

    String url = String.format(PROFILE_URL, guid);
    Response serviceResponse = null;
    try {
      serviceResponse = authenticationStrategy.executeFeed(url);
    } catch (Exception e) {
      throw new SocialAuthException(
          "Failed to retrieve the user profile from  " + url, e);
    }
    if (serviceResponse.getStatus() != 200) {
      throw new SocialAuthException(
          "Failed to retrieve the user profile from  " + url
              + ". Staus :" + serviceResponse.getStatus());
    }
    String result;
    try {
      result = serviceResponse
          .getResponseBodyAsString(Constants.ENCODING);
      LOG.debug("User Profile :" + result);
    } catch (Exception exc) {
      throw new SocialAuthException("Failed to read response from  "
          + url, exc);
    }
    try {
      JSONObject jobj = new JSONObject(result);
      if (jobj.has("profile")) {
View Full Code Here

    Response serviceResponse = null;
    try {
      serviceResponse = authenticationStrategy.executeFeed(url);
    } catch (Exception ie) {
      throw new SocialAuthException(
          "Failed to retrieve the contacts from " + url, ie);
    }

    List<Contact> plist = new ArrayList<Contact>();
    Element root;
View Full Code Here

TOP

Related Classes of org.brickred.socialauth.exception.SocialAuthException

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.