O'Reilly logo

Spring Security 3.x Cookbook by Anjana Mankale

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Integrating Spring Security with Apache CXF RESTful web service

In this section let us create an Apache CXF RESTful web service. It is an open source web service framework. Let's use BASIC authentication for this demonstration.

CXF supports contract-first and contract-last web services. It also supports RESTful web services.

Let us integrate Spring Security with CXF and authorize a RESTful web service.

Getting ready

  • Add the cxf dependency to the pom file
  • Set up the RESTful web service with CXF
  • Configure the spring-security.xml file

How to do it...

The following are the steps to integrate Spring Security with Apache CXF RESTful web services:

  1. Configure the Book POJO class.
    @XmlRootElement(name = "book") public class Book { private int book_id; private String ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required