crsde
crsde

Reputation: 162

Apache Camel + CXF endpoint authenticatiion

i need to secure simple rest service in Camel, like these

<cxf:rsServer id="usrServer" address="${host}"
                  serviceClass="..."
                  loggingFeatureEnabled="true" loggingSizeLimit="20"/>

but i have no idea how to enable authentication on this endpoint, for examle Digest authentication.

Upvotes: 2

Views: 667

Answers (2)

Namphibian
Namphibian

Reputation: 12211

You have essentially two ways of achieving this:

  1. Configure your apache-camel runtime container to handle the authentication i.e. if you are deploying to Tomcat then configure Tomcat to handle the Digest authentication. ServiceMix and Karaf will use the OSGI PAX web server which will need to be configured.

  2. To secure your CXF REST service please review the CXF documentation around REST service security

Upvotes: 1

vincent
vincent

Reputation: 1234

There's somes ways to secure a rest service and in my opinion it doesn't depends on Camel.

For example, you want to allow access to the service event if the client is not logged. So you have to check his information in the body of you service. That's one way.

One other way, is to use authentication (by login/pwd, token, etc...). That force to have 1 request to obtain your credentials, and 1 request to the service you want.

So, it you want to use Digest authentication, why not. But you have to configure it in your web server, not on the rest service configuration.

Here are a link for apache : http://httpd.apache.org/docs/2.2/fr/mod/mod_auth_digest.html and a like for tomcat http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html

I'm not very used to security, so i don't know if it's help. cheers

Upvotes: 0

Related Questions