Request of bearer token uses wrong Content-Type
Posted: Thu Mar 21, 2024 12:30 pm
Hi everyone,
I have troubles with connecting to OData using OAuth with Bearer.
I have provided the following details: 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
I have troubles with connecting to OData using OAuth with Bearer.
I have provided the following details: 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