title: Apache CXF: How to secure JAX-RS web service with basic authentication
body: <p>I have a Spring application that publishes some RESTful web services using Apache CXF (using jax-rs). I would like to secure access to those services using HTTP basic authentication. The username and password should be in a Spring configuration file. The main application already uses Spring Security and I would prefer not to mess with that setup. </p>
  
  <p>What is the easiest way to do this? I could write my own ServletFilter but surely there must be a way to configure this?</p>