users@jersey.java.net

[Jersey] Re: Prompting for authentication

From: Libor Kramolis <libor.kramolis_at_oracle.com>
Date: Wed, 13 May 2015 22:55:55 +0200

Hello.

I think you are looking for BASIC NON-PREEMPTIVE mode.

Best regards,
Libor


> On 13 May 2015, at 19:54, Scott Palmer <swpalmer_at_gmail.com> wrote:
>
> I'm looking for examples of how I can prompt the user of my client application to enter credentials only when they are required by the server. I'm using Jersey 2.16.
>
> I've looked at the documentation: "5.9.1. Http Authentication Support"
> https://jersey.java.net/nonav/documentation/latest/client.html#d0e5181 <https://jersey.java.net/nonav/documentation/latest/client.html#d0e5181>
>
> But it is all about setting up the credentials ahead of time. That's not what I want. The user will be ale to enter a URL, some will need credentials and some won't, but until the request is made we don't know. I want to prompt for the credentials on demand.
>
> Regards,
>
> Scott