title: Authenticate Camel REST API using Basic Authentication or oAuth token validation
body: <p>I am new to Camel (on Spring Boot) and implementing REST API using "netty-http" component.</p>
  
  <p>For Basic auth on a service, I know that we can validate the headers in a .process method in the route, but I am not sure if that is a best practice.</p>
  
  <p>I wanted to know if anyone can share some info on implementing Basic Auth or oAuth validation on the Camel Routes using spring security.</p>
  
  <p>Java DSL Code below:</p>
  
  <pre><code>@Component
  public class RetrieveRestAPI extends RouteBuilder {
  
      @Autowired
      RetrieveData retrieveData;
  
  
  
      @Override
      public void configure() throws Exception {
  
          restConfiguration()
                  .component("netty-http") 
                  .port("{{http.port}}")
                  .bindingMode(RestBindingMode.auto)
                  ;
  
          //TODO: Basic Auth
          //TODO: oAuth token validation..
  
          rest("/{{BasePath}}/{DataId}")
                  .get()
                  .to("direct:fetchData");
  
          from("direct:fetchData")
                  .process(new Processor() {
                      @Override
                      public void process(Exchange exchange) throws Exception {
                          log.info("some code here..");
                      }
                  })
  
                  .end();
      }
  </code></pre>
  
  <p>Thanking you,
  V.</p>