Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jersey-dev] Proxy Basic Authentication Tips
  • From: Jan Supol <jan.supol@xxxxxxxxxx>
  • Date: Wed, 16 Aug 2023 15:47:24 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fr7k4Kip9XEMFv3Mo7komJb6hhmHfLoH6KYCQ8deKNA=; b=EVvUTtWBPy+iWfXyzJ7jaGRPzrmVdu5JpQqtynuvS+Hb3p1/T5cyyt4FRMyQUkAgOJTBy6wCS2WBP0u5NiPagj6sF1jt88x7Ln7IFDBxrEeKObNR8hNRB0FlWSiPFzpX4zY7c9NmbE4eFQVHvZyuzcz4C5D6Fk+z40w/ipI2PKZSxMeVnMAo8O1S3FE4LgGwtMmVN7/iVhdkb+W8QPEJ5fOic2lLvtcIOp9Gr/jhWDBUjNAlTtaBqBIswA+EfKpIX1QcAtkQ7Lfn9+SrWgc1VVOmM3LiImJSA3VTi94wdHS6AomTzCwKImeSTP2CWqjde6VoBJDFd8r+cOQrMBCRpw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WyjUs3UQNPTeCuYJQZaTRyLILcq02fyrN68p0AZ40+BcX8hg7vgA3PgnqdBExqCXYgl+EWTpROmjkdFHRaJffJQePnHUb2hcCAYp1TIM/d+OLIz79FCwVzZwUjQCYEO2zVpnSaWJf5BIt4WN+y2KY9LsG3lOrGu6ZfhPbqmu4jMvtWvGf+a+dLaKHEwMBoQXMPaZdEnu348RSEadDRaUbe7afszdakvEkdRVmNDlC2WnZ46wROYYj7+we8is4dxkGTqjRPTYRZ5w309w92bZOBSOfhP+3UTNcgq5j3MI4AnEDIk6Qri1j7jubt5exSgccBQFCpaRM/7DbmOXFQKoSw==
  • Delivered-to: jersey-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/jersey-dev/>
  • List-help: <mailto:jersey-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/jersey-dev>, <mailto:jersey-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/jersey-dev>, <mailto:jersey-dev-request@eclipse.org?subject=unsubscribe>
  • Msip_labels:
  • Thread-index: AQHZz8qK0UBwtvMYCUqS5XVZqIvGT6/tA/A4
  • Thread-topic: Proxy Basic Authentication Tips

Hi,
I am not sure I understand the issue.

  • We saw that the HttpAuthenticationFilter adds an Authorization header with the basic authentication, and that's why there's a condition to not execute the authentication process if this header exists on the original request.
Do I understand correctly that you want to repeat the authentication again to another endpoint? If so, can you create another filter with higher priority than HttpAuthenticationFilter, remove the REQUEST_PROPERTY_FILTER_REUSED property, and set the new URI in ClientRequestContext?

Or you want to make a completely new request from a filter with a lower priority with the new token you received and repeat a similar logic from repeatRequest method?

-- Jan



From: jersey-dev <jersey-dev-bounces@xxxxxxxxxxx> on behalf of Thiago Cardoso Silva via jersey-dev <jersey-dev@xxxxxxxxxxx>
Sent: Wednesday, August 16, 2023 1:01 AM
To: jersey-dev@xxxxxxxxxxx <jersey-dev@xxxxxxxxxxx>
Cc: Thiago Cardoso Silva <t.cardoso@xxxxxxxxxxxxxx>
Subject: [External] : [jersey-dev] Proxy Basic Authentication Tips
 
Hi!

I'm facing a problem at work and can't find any alternatives. 
We need to call an external API and for that, we have to pass by the proxy with authentication. For the first request, to get an access token, we are using the feature that adds the HttpAuthenticationFilter.

So, for that, with my user and password, everything is ok. But now, I need to call another endpoint passing the token from the previous request as an Authorization header.

We saw that the HttpAuthenticationFilter adds an Authorization header with the basic authentication, and that's why there's a condition to not execute the authentication process if this header exists on the original request.

We got the working using OkHttp, but I know they use another process for the authentication. There's something we can do to provide something similar?

Thanks in advance.

Back to the top