Package waffle.spring

Class NegotiateSecurityFilter

java.lang.Object
org.springframework.web.filter.GenericFilterBean
waffle.spring.NegotiateSecurityFilter
All Implemented Interfaces:
jakarta.servlet.Filter, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.EnvironmentAware, org.springframework.core.env.EnvironmentCapable, org.springframework.web.context.ServletContextAware
Direct Known Subclasses:
DelegatingNegotiateSecurityFilter

public class NegotiateSecurityFilter extends org.springframework.web.filter.GenericFilterBean
A Spring Negotiate security filter.
  • Field Summary

    Fields inherited from class org.springframework.web.filter.GenericFilterBean

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instantiates a new negotiate security filter.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain)
     
    org.springframework.security.core.GrantedAuthority
    Gets the default granted authority.
    Gets the granted authority factory.
    waffle.windows.auth.PrincipalFormat
    Gets the principal format.
    waffle.servlet.spi.SecurityFilterProviderCollection
    Gets the provider.
    waffle.windows.auth.PrincipalFormat
    Gets the role format.
    boolean
    Checks if is allow guest login.
    boolean
    Checks if is impersonate.
    protected void
    sendUnauthorized(jakarta.servlet.http.HttpServletResponse response, boolean close)
    Send a 401 Unauthorized along with protocol authentication headers.
    void
    setAllowGuestLogin(boolean value)
    Sets the allow guest login.
    protected boolean
    setAuthentication(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)
    Invoked when authentication towards ad was succesful to populate securitycontext Override to add service provider authorization checks.
    void
    setDefaultGrantedAuthority(org.springframework.security.core.GrantedAuthority value)
    Sets the default granted authority.
    void
    Sets the granted authority factory.
    void
    setImpersonate(boolean value)
    Enable/Disable impersonation.
    void
    Sets the principal format.
    void
    setPrincipalFormatEnum(waffle.windows.auth.PrincipalFormat value)
    Sets the principal format enum.
    void
    setProvider(waffle.servlet.spi.SecurityFilterProviderCollection value)
    Sets the provider.
    void
    Sets the role format.
    void
    setRoleFormatEnum(waffle.windows.auth.PrincipalFormat value)
    Sets the role format enum.

    Methods inherited from class org.springframework.web.filter.GenericFilterBean

    addRequiredProperty, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NegotiateSecurityFilter

      public NegotiateSecurityFilter()
      Instantiates a new negotiate security filter.
  • Method Details

    • doFilter

      public void doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException
      Throws:
      IOException
      jakarta.servlet.ServletException
    • setAuthentication

      protected boolean setAuthentication(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)
      Invoked when authentication towards ad was succesful to populate securitycontext Override to add service provider authorization checks.
      Parameters:
      request - the request
      response - the response
      authentication - the authentication
      Returns:
      true, if successful
    • afterPropertiesSet

      public void afterPropertiesSet() throws jakarta.servlet.ServletException
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Overrides:
      afterPropertiesSet in class org.springframework.web.filter.GenericFilterBean
      Throws:
      jakarta.servlet.ServletException
    • sendUnauthorized

      protected void sendUnauthorized(jakarta.servlet.http.HttpServletResponse response, boolean close)
      Send a 401 Unauthorized along with protocol authentication headers.
      Parameters:
      response - HTTP Response
      close - Close connection.
    • getPrincipalFormat

      public waffle.windows.auth.PrincipalFormat getPrincipalFormat()
      Gets the principal format.
      Returns:
      the principal format
    • setPrincipalFormatEnum

      public void setPrincipalFormatEnum(waffle.windows.auth.PrincipalFormat value)
      Sets the principal format enum.
      Parameters:
      value - the new principal format enum
    • setPrincipalFormat

      public void setPrincipalFormat(String value)
      Sets the principal format.
      Parameters:
      value - the new principal format
    • getRoleFormat

      public waffle.windows.auth.PrincipalFormat getRoleFormat()
      Gets the role format.
      Returns:
      the role format
    • setRoleFormatEnum

      public void setRoleFormatEnum(waffle.windows.auth.PrincipalFormat value)
      Sets the role format enum.
      Parameters:
      value - the new role format enum
    • setRoleFormat

      public void setRoleFormat(String value)
      Sets the role format.
      Parameters:
      value - the new role format
    • isAllowGuestLogin

      public boolean isAllowGuestLogin()
      Checks if is allow guest login.
      Returns:
      true, if is allow guest login
    • setAllowGuestLogin

      public void setAllowGuestLogin(boolean value)
      Sets the allow guest login.
      Parameters:
      value - the new allow guest login
    • setImpersonate

      public void setImpersonate(boolean value)
      Enable/Disable impersonation.
      Parameters:
      value - true to enable impersonation, false otherwise
    • isImpersonate

      public boolean isImpersonate()
      Checks if is impersonate.
      Returns:
      true if impersonation is enabled, false otherwise
    • getProvider

      public waffle.servlet.spi.SecurityFilterProviderCollection getProvider()
      Gets the provider.
      Returns:
      the provider
    • setProvider

      public void setProvider(waffle.servlet.spi.SecurityFilterProviderCollection value)
      Sets the provider.
      Parameters:
      value - the new provider
    • getGrantedAuthorityFactory

      public GrantedAuthorityFactory getGrantedAuthorityFactory()
      Gets the granted authority factory.
      Returns:
      the granted authority factory
    • setGrantedAuthorityFactory

      public void setGrantedAuthorityFactory(GrantedAuthorityFactory value)
      Sets the granted authority factory.
      Parameters:
      value - the new granted authority factory
    • getDefaultGrantedAuthority

      public org.springframework.security.core.GrantedAuthority getDefaultGrantedAuthority()
      Gets the default granted authority.
      Returns:
      the default granted authority
    • setDefaultGrantedAuthority

      public void setDefaultGrantedAuthority(org.springframework.security.core.GrantedAuthority value)
      Sets the default granted authority.
      Parameters:
      value - the new default granted authority