Spring Boot: Secured RESTful API using Spring Social and Spring Security
SocialAuthenticationFilter
by default, redirects to '/signup'
in the case you described, user is signed in from a social app, however, no local account exists. You can provide a handler to create a local account. This is also covered in the spring-socal
samples.
@RequestMapping(value = { "/signup" }, method = RequestMethod.GET)public String newRegistrationSocial(WebRequest request, Model model) throws Exception { String view = "redirect:/home"; try { Connection<?> connection = providerSignInUtils.getConnectionFromSession(request); if (connection != null) { UserProfile up = connection.fetchUserProfile(); registerUser(up.getFirstName(), up.getLastName(), up.getEmail(), "DummyPassword"); providerSignInUtils.doPostSignUp(up.getEmail(), request); //SignInUtils.signin(up.getEmail()); ... ... } } return view;}