org.wso2.carbon.webapp.mgt.filter

## Class AuthorizationHeaderFilter

- java.lang.Object
- - org.wso2.carbon.webapp.mgt.filter.AuthorizationHeaderFilter

- All Implemented Interfaces:
    javax.servlet.Filter

      @WebFilter(value="/AuthorizationHeaderFilter")
      public class AuthorizationHeaderFilter
      extends Object
      implements javax.servlet.Filter

  Servlet Filter implementation class for authorization header validation. This handles the NPE thrown by CXF transport exposing the stack-trace and server information to the end user for authorization headers with invalid encoded json data by sending a proper error response back to the user. If there is more than single space between auth_type and json data this will modify the header to be in correct format and pass the request along the filter chain.
  Since:
    4.7.6

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AuthorizationHeaderFilter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Clean up any resources being held by the filter.
    `void` | `doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)` Validate the authorization header.
    `void` | `init(javax.servlet.FilterConfig fConfig)` Initialize AuthorizationHeaderFilter.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AuthorizationHeaderFilter

          public AuthorizationHeaderFilter()

  - ### Method Detail

    - #### init

          public void init(javax.servlet.FilterConfig fConfig)
                    throws javax.servlet.ServletException

      Initialize AuthorizationHeaderFilter.
      Specified by:
        `init` in interface `javax.servlet.Filter`
      Parameters:
        `fConfig` - FilterConfig
      Throws:
        `javax.servlet.ServletException`

    - #### doFilter

          public void doFilter(javax.servlet.ServletRequest request,
                               javax.servlet.ServletResponse response,
                               javax.servlet.FilterChain chain)
                        throws IOException,
                               javax.servlet.ServletException

      Validate the authorization header.
      Specified by:
        `doFilter` in interface `javax.servlet.Filter`
      Parameters:
        `request` - ServletRequest
        `response` - ServletResponse
        `chain` - FilterChain
      Throws:
        `IOException`
        `javax.servlet.ServletException`

    - #### destroy

          public void destroy()

      Clean up any resources being held by the filter.
      Specified by:
        `destroy` in interface `javax.servlet.Filter`

Copyright © 2019 WSO2. All rights reserved.