title: How to Intercept REST endpoint to receive all headers?
body: <p>My current code is</p>
  
  <pre><code>@Path("login")
  @RequestScoped
  public class LoginResource {
  
      @GET
      @SecurityChecked
      public Response getUser(@HeaderParam("AUTH") @Nonnull final String authToken) {
          return Response.ok("authenticated successfully.").build();
      }
  }
  </code></pre>
  
  <p>and <code>@SecurityChecked</code> is custom annotation as </p>
  
  <pre><code>import java.lang.annotation.ElementType;
  import java.lang.annotation.Inherited;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  import java.lang.annotation.Target;
  
  import javax.interceptor.InterceptorBinding;
  
  @Inherited
  @InterceptorBinding
  @Target({ ElementType.TYPE, ElementType.METHOD })
  @Retention(RetentionPolicy.RUNTIME)
  public @interface SecurityChecked {
  
  }
  </code></pre>
  
  <p>and Interceptor class as</p>
  
  <pre><code>@Interceptor
  @SecurityChecked
  public class SecurityCheckInterceptor {
      private static final Logger LOGGER = LoggerFactory.getLogger("SecurityCheckInterceptor");
  
      @AroundInvoke
      public Object validateUser(final InvocationContext context) throws Exception {
  
          final Object[] params = context.getParameters();
  
          LOGGER.info("Authentication token: " + Arrays.toString(params));
          return context.proceed();
      }
  }
  </code></pre>
  
  <p>When I run it I see</p>
  
  <pre><code> Authentication token: [1a629d035831feadOO4uFReLyEW8aTmrCS]
  </code></pre>
  
  <p><strong>Problem?</strong><br>
  - In my resource class I had to pass the <code>@HeaderParam</code> parameter<br>
  - How can I read all the <code>HTTP</code> headers coming from client?  </p>
  
  <p><strong>Ideal?</strong><br>
  - If the <code>getUser()</code> does not take any <code>@HeaderParam</code> input and<br>
  - Interceptor should be able to give you all the <code>HTTP</code> Headers  </p>
  
  <p>How can I do that?  </p>