title: How to disable authorization for a request having particular headers in spring boot security?
body: <p>Currently I have a spring boot app that uses oauth2 authorization and validates a request with token against the jwt resource server.</p>
  <pre><code>@Configuration
  public class CustomSecurityConfiguration extends WebSecurityConfigurerAdapter {
  
   @Override
      protected void configure(HttpSecurity http) throws Exception {
          http
              .authorizeRequests(authz -&gt; authz
                  .anyRequest().authenticated())
              .oauth2ResourceServer(oauth2 -&gt; oauth2.jwt());
      }
  }
  </code></pre>
  <p>How can i disable this authorization for a request having particular headers? For example if a request comes with a header as &quot;internal-key&quot;, I want to disable jwt authorization for such requests and allow that request.</p>