views:

167

answers:

2

Is there an easy way to secure RESTful API exposed via Apache CXF's JAX-RS implementation? Are there any hooks for security via Spring Security?.

I heard of people using Basic Authentication over HTTPS, but I haven't seen any actual examples. Any ideas would be greatly appreciated.

Thanks!

A: 

Don't know about CXF, but in Resteasy you can configure it as you would for any other web application, and then do..

@Context private SecurityContext sc;

Which allows you to check things such as sc.isUserInRole("admin");. CXF may provide the same functionality.

Robert Wilson