Skip to content

Instantly share code, notes, and snippets.

@asouza
Created April 27, 2016 14:36
Show Gist options
  • Save asouza/3c1adea11db7bd6e9404c5ee7a9e7835 to your computer and use it in GitHub Desktop.
Save asouza/3c1adea11db7bd6e9404c5ee7a9e7835 to your computer and use it in GitHub Desktop.
@Controller
@Transactional
public class FacebookLoginController {
@Autowired
private Facebook facebook;
@RequestMapping(value = "/facebook/login", method = RequestMethod.GET)
public ModelAndView handleFacebookLogin(HttpServletResponse response) {
User profile = facebook.fetchObject("me", User.class, "id", "name", "link", "email");
System.out.println(profile.getName());
return new ModelAndView("redirect:/dashboard");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment