Uploaded image for project: 'Quarkus'
  1. Quarkus
  2. QUARKUS-6607

Use MultiMap set method instead of add for client assertion parameters

XMLWordPrintable

      The issue is in OidcClientImpl.java, where `add()` is used instead of `set()` for JWT bearer authentication parameters. Other authentication methods correctly use `set()`.

      This causes a mismatch between the expected behavior (replacing previous values) and the actual behavior (accumulating values).

      Replaced the `add()` method calls with `set()` in the JWT bearer authentication code path:

      ```java
      // Replace these lines:
      body.add(OidcConstants.CLIENT_ASSERTION, clientAssertion);
      body.add(OidcConstants.CLIENT_ASSERTION_TYPE, OidcConstants.JWT_BEARER_CLIENT_ASSERTION_TYPE);

      // With:
      body.set(OidcConstants.CLIENT_ASSERTION, clientAssertion);
      body.set(OidcConstants.CLIENT_ASSERTION_TYPE, OidcConstants.JWT_BEARER_CLIENT_ASSERTION_TYPE);
      ```

      This would ensure only the newest key-value pairs are included in the request, eliminating the duplication problem.

      • Fixes: #48879

              paul.robinson@redhat.com Paul Robinson
              blafond Barry LaFond
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: