grafana / grafana-infinity-datasource

CSV, JSON, GraphQL, XML and HTML datasource for grafana.
https://grafana.com/docs/plugins/yesoreyeram-infinity-datasource
Apache License 2.0
765 stars 103 forks source link

[Bug] oauth2: cannot fetch token: 415 Unsupported Media Type Response #956

Closed rv-qjohnston closed 2 months ago

rv-qjohnston commented 3 months ago

Describe the bug

Unable to generate an auth0 token using clientId and secret. Receive error that oauth2: cannot fetch token: 415 Unsupported Media Type Response.

Steps to reproduce

Create a data source with the below configuration:

When performing a query, receive this error:

oauth2: cannot fetch token: 415 Unsupported Media Type Response: {"type":"https://tools.ietf.org/html/rfc9110#section-15.5.16","title":"Unsupported Media Type","status":415,"traceId":"00-6faa912765b51b3bc33d48412c697167-95571988308e9835-00"}

Version Details:

Additional context

The below curl using api documentation works successfully to generate a token:

Request: curl --request POST \ --url https://api.example.com/api/v1/auth/api-token \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data '{ "clientId": "string", "secret": "string" }'

Response: { "token": *", "refresh_token": "***", "expires_in": 86400 }