1

I recently built a RESTful service using Jersey and is currently used by 3 other systems internal to the network (not people).

  1. How can I make sure the requests to the service are honored only based on hostname/IP address.
  2. The service is local to the network and so Im not using HTTPS
  3. Any opensource ideas/example code would be of great help.

Thanks

2 Answers2

0

You could just write a simple Servlet Filter that extracts IP address from the request and accepts it or denies and terminates any further processing.

See an example - https://community.jboss.org/wiki/LimitAccessToCertainClients?_sscc=t

However i think that such kind of authentication should be done before the application - by an application server or a firewall.

kairius
  • 101
0

There were a couple of suggestions and ideas that I tried. Eventually we decided to settle with Service based authentication. OAUTH2 was recommended by other experts and we implemented it successfully with Token based authentication using Referrer URLs and Scope. Thanks everyone for the suggestions.