Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
Maybe a firewall on the server itself? –  smcg Jun 26 '12 at 17:18

2 Answers 2

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.

share|improve this answer
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.