Skip to content

Instantly share code, notes, and snippets.

@eugenp
Created October 29, 2011 21:08
Show Gist options
  • Save eugenp/1325097 to your computer and use it in GitHub Desktop.
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
@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" );
}
}
@eugenp
Copy link
Author

eugenp commented Nov 6, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment