Package de.deltatree.social.web.filter.api

Examples of de.deltatree.social.web.filter.api.SASFHelper


    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) {
View Full Code Here


   *             if an error occurs
   */
  @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();
    }
View Full Code Here

  }

  public void doFilter(final HttpServletRequest req,
      final HttpServletResponse res, final FilterChain fc)
      throws Exception {
    SASFHelper h = new DefaultSASFHelper(req, this.props,
        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) {
        h.setError(t.getMessage(), t);
        res.sendRedirect(h.getErrorPage());
        return;
      }
    }
    if (!res.isCommitted()) {
      fc.doFilter(req, res);
View Full Code Here

   *             if an error occurs
   */
  @Action(value = "/socialAuthSuccessAction")
  public String execute() throws Exception {

    SASFHelper helper = SASFStaticHelper.getHelper(request);
    try {
      Profile profile = helper.getProfile();

      List<Contact> contactsList = helper.getContactList();

      if (contactsList != null && contactsList.size() > 0) {
        for (Contact p : contactsList) {
          if (StringUtils.isEmpty(p.getFirstName())
              && StringUtils.isEmpty(p.getLastName())) {
View Full Code Here

  @Action(value = "/socialAuth")
  public String execute() throws Exception {
    LOG.info("Given provider id :: " + id);

    SASFHelper helper = SASFStaticHelper.getHelper(request);
    if (mode == null) {
      url = "http://opensource.brickred.com/socialauth-struts-filter-demo/SAF/SocialAuth?id="
          + id;
      return "forward";

    } else if ("signout".equals(mode)) {
      SocialAuthManager manager = null;
      if (helper != null) {
        manager = helper.getAuthManager();
        if (manager != null) {
          manager.disconnectProvider(id);
        }
      }
      return "home";
View Full Code Here

TOP

Related Classes of de.deltatree.social.web.filter.api.SASFHelper

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.