Skip to content

feat: Migrate to HttpClient5 in OAuth2Service#1103

Open
Jonas-Isr wants to merge 18 commits intomainfrom
http5-oauth2
Open

feat: Migrate to HttpClient5 in OAuth2Service#1103
Jonas-Isr wants to merge 18 commits intomainfrom
http5-oauth2

Conversation

@Jonas-Isr
Copy link
Member

Context

https://github.com/SAP/ai-sdk-java-backlog/issues/328

This PR migrates the OAuth2Service to use HttpClient5 internally. In order to do this, the new class HttpClient5OAuth2TokenService is introduced (and tested) in place of the previously used com.sap.cloud.security.xsuaa.client.DefaultOAuth2TokenService which relies on HttpClient4.

Feature scope:

  • Implement HttpClient5OAuth2TokenService
  • Test HttpClient5OAuth2TokenService
  • Test usage of HttpClient5OAuth2TokenService

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Documentation updated
  • Release notes updated

@Jonas-Isr Jonas-Isr self-assigned this Feb 26, 2026
Comment on lines +87 to +89
@Test
@DisplayName( "createHttpClient with non-certificate-based ClientIdentity should return default HTTP client" )
void testCreateHttpClientWithNonCertificateBasedClientIdentity()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could maybe remove some if these first tests of createHttpClient. But technically they all test different behaviours.

@Jonas-Isr Jonas-Isr marked this pull request as ready for review March 3, 2026 14:35
Copy link
Contributor

@CharlesDuboisSAP CharlesDuboisSAP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not put your new HttpClient5OAuth2TokenService in the security library? They might have more tests to make sure it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants