users@jersey.java.net

Re: [Jersey] jax-rs - host ip ?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 28 Jul 2009 15:30:23 +0200

On Jul 28, 2009, at 3:27 PM, jp wrote:

> Paul Sandoz escribió:
>>
>> On Jul 28, 2009, at 2:24 PM, jp wrote:
>>
>>> Hi,
>>>
>>> I'm using netbeans 6.7, I have an app. that publish some REST web
>>> service, I would like to known if there is a way to known which
>>> host ip
>>> is invoking the web service.
>>>
>>
>> Inject the HttpServletRequest e.g.:
>>
>> @Context HttpServletRequest hsr.
>>
>>
>>> I'm evaluating put some security on my web services ... some
>>> ideas ? or
>>> advices ?
>>
>> What do you want to do?
>
> Thanks Paul!
> hsr.getRemoteHost(); works perfect.
>
> I want at least authenticate users ... I'm reading Acegi Security,

OK, note that i really do not know much about Spring security, others
on this list might though.


> What
> do you think / recommend ?
>

I know others have used Acegi/Spring security in their JAX-RS apps.


> In the future may be I need SSL ...
>

Yes, that is definitely a container configuration. There are samples
distributed with Jersey to enable SSL with Grizzly and Glassfish.

Paul.