Page 1 of 1

Request of bearer token uses wrong Content-Type

Posted: Thu Mar 21, 2024 12:30 pm
by d.pujdak
Hi everyone,

I have troubles with connecting to OData using OAuth with Bearer.

I have provided the following details:
screen_20240321_1304_330.png
screen_20240321_1304_330.png (24.31 KiB) Viewed 1289 times
I got 400 when I click test connection. After the investigation I have found the following Server Info:
POST: /connect/token
INFO|OpenIddict.Server.OpenIddictServerDispatcher|The request URI matched a server endpoint: Token.
INFO|OpenIddict.Server.OpenIddictServerDispatcher|The request was rejected because an invalid 'Content-Type' header was specified: application/json.
INFO|OpenIddict.Server.OpenIddictServerDispatcher|The response was successfully returned as a JSON document: {
"error": "invalid_request",
"error_description": "The specified 'Content-Type' header is invalid.",
"error_uri": "https://documentation.openiddict.com/errors/ID2082"
}.

Based on the error message I have found that the request for bearer token has wrong content-type (application/json). Is this intentional, can I change it somewhere in options?
Because based on the https://www.rfc-editor.org/rfc/rfc6749#section-4.1.1 it should be using the "application/x-www-form-urlencoded" format.

Please also refer to:
https://datatracker.ietf.org/doc/html/r ... tion-4.3.2
https://stackoverflow.com/questions/409 ... -in-oauth2
https://auth0.com/docs/api/authenticati ... r-password

Re: Bearer token using wrong Content-Type

Posted: Thu Mar 21, 2024 12:43 pm
by d.pujdak

Re: Request of bearer token uses wrong Content-Type

Posted: Thu Mar 21, 2024 8:00 pm
by Lech Kulikowski
Hello,

We need some time to investigate the issue, we will let you know about the result.

Thank you.
#14092

Re: Request of bearer token uses wrong Content-Type

Posted: Mon Apr 15, 2024 7:48 am
by Lech Kulikowski
Hello,

The issue is fixed. Please check the next release build.

Thank you.