Created
October 29, 2011 21:08
-
-
Save eugenp/1325097 to your computer and use it in GitHub Desktop.
Securing a RESTful Web Service with Spring Security 3.1, part 3 - the entry point
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component( "restAuthenticationEntryPoint" ) | |
public final class RestAuthenticationEntryPoint implements AuthenticationEntryPoint{ | |
@Override | |
public final void commence | |
( HttpServletRequest request, HttpServletResponse response, AuthenticationException authException ) | |
throws IOException{ | |
response.sendError( HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized" ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gist is used in:
http://www.baeldung.com/2011/10/31/securing-a-restful-web-service-with-spring-security-3-1-part-3/