Class HudsonAuthenticationEntryPoint

java.lang.Object
hudson.security.HudsonAuthenticationEntryPoint
All Implemented Interfaces:
org.springframework.security.web.AuthenticationEntryPoint

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class HudsonAuthenticationEntryPoint extends Object implements org.springframework.security.web.AuthenticationEntryPoint
For anonymous requests to pages that require authentication, first respond with HttpServletResponse.SC_FORBIDDEN, then redirect browsers automatically to the login page.

This is a compromise to handle programmatic access and real browsers equally well.

The page that programs see is entirely white, and it auto-redirects, so humans wouldn't notice it.

Author:
Kohsuke Kawaguchi
  • Constructor Details

    • HudsonAuthenticationEntryPoint

      public HudsonAuthenticationEntryPoint(String loginFormUrl)
  • Method Details

    • commence

      public void commence(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse rsp, org.springframework.security.core.AuthenticationException reason) throws IOException, jakarta.servlet.ServletException
      Specified by:
      commence in interface org.springframework.security.web.AuthenticationEntryPoint
      Throws:
      IOException
      jakarta.servlet.ServletException