Package org.brickred.socialauth

Examples of org.brickred.socialauth.SocialAuthManager


    id = null;
    provider = null;
    config = new SocialAuthConfig();
    try {
      config.load();
      manager = new SocialAuthManager();
      manager.setSocialAuthConfig(config);
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here


    if (statusMessage == null || statusMessage.trim().length() == 0) {
      request.setAttribute("Message", "Status can't be left blank.");
      return "failure";
    }
    SASFHelper helper = SASFStaticHelper.getHelper(request);
    SocialAuthManager manager = helper.getAuthManager();
    AuthProvider provider = null;
    if (manager != null) {
      provider = manager.getCurrentAuthProvider();
    }
    if (provider != null) {
      try {
        provider.updateStatus(statusMessage);
        request.setAttribute("Message", "Status Updated successfully");
View Full Code Here

   */
  @Action(value = "/socialAuthUploadPhotoAction")
  public String execute() throws Exception {

    SASFHelper helper = SASFStaticHelper.getHelper(request);
    SocialAuthManager manager = helper.getAuthManager();

    AuthProvider provider = null;
    if (manager != null) {
      provider = manager.getCurrentAuthProvider();
    }
    if (provider != null) {
      try {
        provider.uploadImage(statusMessage, imageFileFileName,
            new FileInputStream(imageFile));
View Full Code Here

        this.sdbSocialAuthManager, req.getSession());
    String path = lookupPath(req);
    if (path != null && path.startsWith(h.getServletMain())) {
      try {
        if (path.equals(h.getServletSuccess())) {
          SocialAuthManager manager = h.getAuthManager();
          AuthProvider provider = manager.connect(SocialAuthUtil
              .getRequestParametersMap(req));
          h.setProvider(provider);
          res.sendRedirect(h.getWebappSuccessAction());
          return;
        } else {
          String id = req.getParameter("id");
          SocialAuthManager socialAuthManager = null;
          synchronized (req.getSession()) {
            if (h.getAuthManager() != null) {
              socialAuthManager = h.getAuthManager();
            } else {
              socialAuthManager = h.getMgr()
                  .getSocialAuthManager();
              h.setAuthManager(socialAuthManager);
            }
          }

          res.sendRedirect(socialAuthManager.getAuthenticationUrl(id,
              h.getOpenidReturnUrl()));
          return;

        }
      } catch (Throwable t) {
View Full Code Here

  }

  @Override
  public Profile getProfile() {
    Profile profile = null;
    SocialAuthManager manager = getAuthManager();
    if (manager != null) {
      try {
        AuthProvider provider = manager.getCurrentAuthProvider();
        profile = provider.getUserProfile();

      } catch (Exception e) {
        e.printStackTrace();
      }
View Full Code Here

  }

  @Override
  public List<Contact> getContactList() {
    List<Contact> contactsList = null;
    SocialAuthManager manager = getAuthManager();
    if (manager != null) {
      contactsList = new ArrayList<Contact>();
      try {
        AuthProvider provider = manager.getCurrentAuthProvider();
        contactsList = provider.getContactList();
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
View Full Code Here

   */
  @Override
  public SocialAuthManager getSocialAuthManager()
      throws SASFSecurityException {
    try {
      SocialAuthManager socialAuthManager = new SocialAuthManager();
      socialAuthManager.setSocialAuthConfig(this.socialAuthConfig);
      return socialAuthManager;
    } catch (Exception e) {
      throw new SASFSecurityException(e);
    }
  }
View Full Code Here

  private SocialAuthTemplate socialAuthTemplate;

  @RequestMapping(value = "/authSuccess")
  public ModelAndView getRedirectURL(final HttpServletRequest request)
      throws Exception {
    SocialAuthManager manager = socialAuthTemplate.getSocialAuthManager();
    AuthProvider provider = manager.getCurrentAuthProvider();
    HttpSession session = request.getSession();
    String type = null;
    if (session.getAttribute(Constants.REQUEST_TYPE) != null) {
      type = (String) session.getAttribute(Constants.REQUEST_TYPE);
    }
    if (type != null) {
      if (Constants.REGISTRATION.equals(type)) {
        return registration(provider);
      } else if (Constants.IMPORT_CONTACTS.equals(type)) {
        return importContacts(provider);
      } else if (Constants.SHARE.equals(type)) {
        return new ModelAndView("shareForm", "connectedProvidersIds",
            manager.getConnectedProvidersIds());
      }
    }

    return null;
  }
View Full Code Here

  @RequestMapping(value = "/shareForm")
  public ModelAndView shareForm(final HttpServletRequest request) {
    logger.info("Showing share form");
    HttpSession session = request.getSession();
    session.setAttribute(Constants.REQUEST_TYPE, Constants.SHARE);
    SocialAuthManager manager = socialAuthTemplate.getSocialAuthManager();
    List<String> connectedProvidersIds = new ArrayList<String>();
    if (manager != null) {
      connectedProvidersIds = manager.getConnectedProvidersIds();
    }

    ModelAndView modelAndView = new ModelAndView("shareForm",
        "connectedProvidersIds", connectedProvidersIds);
    return modelAndView;
View Full Code Here

      @RequestParam(value = "message", required = true) final String message,
      final HttpServletRequest request) {
    logger.info("Showing share form");
    HttpSession session = request.getSession();
    session.setAttribute(Constants.REQUEST_TYPE, Constants.SHARE);
    SocialAuthManager manager = socialAuthTemplate.getSocialAuthManager();
    List<String> connectedProvidersIds = new ArrayList<String>();
    if (manager != null) {
      connectedProvidersIds = manager.getConnectedProvidersIds();
    }
    String providerIds = null;
    for (String id : connectedProvidersIds) {
      try {
        AuthProvider provider = manager.getProvider(id);
        provider.updateStatus(message);
        if (providerIds == null) {
          providerIds = provider.getProviderId();
        } else {
          providerIds += ", " + provider.getProviderId();
View Full Code Here

TOP

Related Classes of org.brickred.socialauth.SocialAuthManager

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.