Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Security

Jens Reimann edited this page Nov 20, 2015 · 2 revisions

OSGi - JAX-RS Security

An OSGi friendly integration of Jersey's/JAX-RS security features comes with the bundle com.eclipsesource.jaxrs.provider.security. This bundle provides two interfaces that needs to be implemented and registered as OSGi services:

Integration

To use the security integration you need to start the bundle com.eclipsesource.jaxrs.provider.security and implement the two handlers explained above.

Example

An example that shows how to integrate these features can be found in the bundle com.eclipsesource.jaxrs.security.example. This bundle contains also an Eclipse launch configuration in the folder launchers called JAX-RS Security Example.launch. After starting the example you can access two services:

  • public service: A public service can be accessed by sending a GET request to http://localhost:9090/services/security/unsecure.
  • private service: A secured service can be accessed by sending a GET request to http://localhost:9090/services/security/secure'. Please note that you need to send a request header for authentication user=test. Otherwise you will receive a 403`.