1 package de.juplo.yourshouter;
3 import java.io.IOException;
4 import javax.servlet.ServletException;
5 import javax.servlet.http.HttpServletRequest;
6 import javax.servlet.http.HttpServletResponse;
7 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory;
9 import org.springframework.security.core.AuthenticationException;
10 import org.springframework.security.web.AuthenticationEntryPoint;
11 import org.springframework.stereotype.Service;
15 * Specialized implementation of {@link AuthenticationEntryPoint}, that
16 * redirects to the social sign-in-page, to let the user decide to sign in or
22 public class SocialAuthenticationEntryPoint implements AuthenticationEntryPoint
24 private static final Logger LOG =
25 LoggerFactory.getLogger(SocialAuthenticationEntryPoint.class);
31 * To commence the sign-in through the Graph-API, we only have to redirect
32 * to our already implemented sign-in-page.
36 HttpServletRequest request,
37 HttpServletResponse response,
38 AuthenticationException exception
45 "redirecting unauthenticated request {} to /signin.html",
46 request.getRequestURI()
48 response.sendRedirect("/signin.html");