Examples of ProviderSignInAttempt


Examples of org.springframework.social.connect.web.ProviderSignInAttempt

        return signInController.signIn(providerId, request);
    }

    @RequestMapping("/socialSignUp")
    public String socialSignupPage(@RequestParam(required=false) String email, NativeWebRequest request, Model model) {
        ProviderSignInAttempt attempt = (ProviderSignInAttempt) request.getAttribute(ProviderSignInAttempt.class.getName(), RequestAttributes.SCOPE_SESSION);
        if (attempt == null && StringUtils.isEmpty(email)) {
            return "redirect:/";
        }
        User user = new User();
        if (attempt != null) {
            Object api = attempt.getConnection().getApi();
            if (api instanceof Facebook) {
                FacebookProfile profile = ((Facebook) api).userOperations().getUserProfile();
                user.setEmail(profile.getEmail());
                user.setNames(profile.getName());
                user.setUsername(profile.getUsername());
View Full Code Here

Examples of org.springframework.social.connect.web.ProviderSignInAttempt

        if (!emailValidator.isValid(email, null)) {
            return "redirect:/?message=Invalid email. Try again";
        }

        // if the session has expired for a fb/tw registration (i.e. attempt is null), do not proceed - otherwise inconsistent data is stored
        ProviderSignInAttempt attempt = (ProviderSignInAttempt) request.getAttribute(ProviderSignInAttempt.class.getName(), RequestAttributes.SCOPE_SESSION);
        if (attempt != null) {
            User user = userService.completeUserRegistration(email, username, names, attempt.getConnection(), loginAutomatically, receiveDailyDigest);
            signInAdapter.signIn(user, (HttpServletResponse) request.getNativeResponse(), true);
        } else if ("Persona".equals(type)){
            User user = userService.completeUserRegistration(email, username, names, null, loginAutomatically, receiveDailyDigest);
            signInAdapter.signIn(user, (HttpServletResponse) request.getNativeResponse(), true);
        }
View Full Code Here

Examples of org.springframework.social.connect.web.ProviderSignInAttempt

      repo.updateConnection(connection);
    }
  }
 
  private void addSignInAttempt(HttpSession session, Connection<?> connection) {
    session.setAttribute(ProviderSignInAttempt.SESSION_ATTRIBUTE, new ProviderSignInAttempt(connection, authServiceLocator, usersConnectionRepository));
  }
View Full Code Here

Examples of org.springframework.social.connect.web.ProviderSignInAttempt

      repo.updateConnection(connection);
    }
  }
 
  private void addSignInAttempt(HttpSession session, Connection<?> connection) {
    session.setAttribute(ProviderSignInAttempt.SESSION_ATTRIBUTE, new ProviderSignInAttempt(connection, authServiceLocator, usersConnectionRepository));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.