users@jersey.java.net

[Jersey] Re: Each new GET, POST, PUT is using a new TCP source port

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Mon, 14 Nov 2011 19:21:13 +0100

Hi Mike,

firstly, relying on unchanged TCP port is really bad idea, you should
reconsider your auth scheme.

However, you should be able to do this by reusing/managing
HttpURLConnections, see
http://jersey.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/client/urlconnection/HttpURLConnectionFactory.html.

Regards,
Pavel

On 11/14/11 7:09 PM, margozzi wrote:
> The RESTful API I am trying to invoke using the Jersey Client requires an
> authentication. Authentication is a REST call. After I do that and try to
> invoke another request, I get an authentication failure response. It is
> because the second request is not sent from the same TCP source port. The
> request is deemed to be from an unauthenticated user and is thus rejected.
>
> Why is the Jersey Client using a new TCP source port for each call? is there
> a way to configure it to NOT do that?
>
> --
> View this message in context: http://jersey.576304.n2.nabble.com/Each-new-GET-POST-PUT-is-using-a-new-TCP-source-port-tp6993468p6993468.html
> Sent from the Jersey mailing list archive at Nabble.com.
>