With this, we have registered (Apache) CXF as a Servlet that listens to incoming requests using the URL-pattern: /api/v1/*. Furthermore, we registered our AuthenticationService class as one of the RESTful services. During start-up, CXF will introspect the class and use the provided JAX-RS annotations to properly configure our service.

Save your changes and publish/deploy your application.

Step 7: View the app

Navigate to the following URL: http://localhost:8080/weatherapp/api/v1/auth. After successful authentication you should see your username.