1

I'm using the Infinity plugin for Grafana the problem is the api I am trying to use first requires me to get a bearer token.

For example using this CLI:

curl --location 'https://serverIpAddress/auth/login' \
     --header 'Content-Type: application/json' \
     --data-raw '{
         "username": "userName",
         "password": "passWord"
     }' \
     --insecure

Then returns :

{"data":{"access_token":"eYtNGVjYS05OD....","refresh_token":"16248292...f"},"metadata":{}}

Only AFTER I get back the access_token can actually make my API call. enter image description here

I coudn't find in any of the documentation on how to first ask for the bearer token then submit the quest

1 Answer 1

0

The OAauth2 auth type for the Infinity Plugin first retrieves the access token like you're describing, but only for the official OAuth2 specification with x-www-form-urlencoded data, not application/json.

If you cannot change the API's login flow, you'd have to fork the Infinity plugin to create your own Grafana data source.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.