Class LoginHeadersCustomizer

java.lang.Object
com.irurueta.authserver.authorization.api.web.login.LoginHeadersCustomizer
All Implemented Interfaces:
LoginChainCustomizer

@Component @Order(0) public class LoginHeadersCustomizer extends Object implements LoginChainCustomizer
Adds the security headers of the server-rendered pages: the content security policy that LoginContentSecurityPolicy builds (same-origin resources only, no framing, and the origin of an absolute branding logo URL for images), X-Content-Type-Options and Referrer-Policy.

The policy deliberately has no form-action directive: browsers also apply it to the redirects that follow a form submission, so form-action 'self' would block the redirect from the login or consent form back to the client application's redirect_uri, which is on another origin.

  • Field Details

    • contentSecurityPolicy

      private final LoginContentSecurityPolicy contentSecurityPolicy
      Builds the content security policy from the branding.
  • Constructor Details

    • LoginHeadersCustomizer

      public LoginHeadersCustomizer()
  • Method Details

    • customize

      public void customize(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
      Description copied from interface: LoginChainCustomizer
      Customizes the login/UI chain.
      Specified by:
      customize in interface LoginChainCustomizer
      Parameters:
      http - security builder of the chain.