Skip to content

fix: accept a content type with parameters like charset for the access token response - #27

Merged
chriskapp merged 3 commits into
1.xfrom
fix/oauth2-token-content-type-parameters
Oct 19, 2026
Merged

chriskapp merged 3 commits into
1.xfrom
fix/oauth2-token-content-type-parameters

Conversation

@dsimons70

@dsimons70 dsimons70 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

The ClientCredentialsDecorator compared the Content-Type of the access token response exactly with application/json. Authorization servers that add a parameter, e.g. Ivalua with application/json;charset=UTF-8, were rejected with "Content type should be: application/json", although it is the same media type (RFC 9110, 8.3). Every request through the decorator failed before it was sent.

  • Compare only the media type in front of the parameters, case-insensitive. Content-Type holds a single value, so it is read once via getHeaderLine().
  • The exception for an invalid status code of the token request contained s% instead of the status code.
  • send() passes the client options to the access token request as well (timeout, proxy, TLS were ignored for it).
  • New ClientCredentialsDecoratorTest: content types with and without parameters, credentials in the body and with strictRfc in the authorization header, client options for the token request, failed token request. The test lives next to the other OAuth2 tests in tests/Unit/Client/OAuth2/.
  • Changelog: the user-facing changes of all tags since 0.2.2 added, sorted by version.

Needed for artemeon/core-ng#35619 (Ivalua client), to be released as 1.1.3.

@dsimons70
dsimons70 requested a review from marcreichel October 19, 2026 13:51
@dsimons70
dsimons70 marked this pull request as draft October 19, 2026 13:51
@dsimons70
dsimons70 requested a review from chriskapp October 19, 2026 13:51
@dsimons70 dsimons70 self-assigned this Oct 19, 2026
@dsimons70
dsimons70 marked this pull request as ready for review October 19, 2026 14:21
@dsimons70
dsimons70 removed the request for review from marcreichel October 19, 2026 14:21
@dsimons70
dsimons70 enabled auto-merge October 19, 2026 14:28
@chriskapp
chriskapp disabled auto-merge October 19, 2026 14:38
@chriskapp
chriskapp merged commit 8a9577d into 1.x Oct 19, 2026
5 checks passed
@chriskapp
chriskapp deleted the fix/oauth2-token-content-type-parameters branch October 19, 2026 14:40
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.

2 participants