Datasource assistance - Can't seem to get connections to work properly

Good afternoon all. I have tried over and over to get a datasource to work for my api calls, but just cant seem to get it right.
I was given a p12 key file with a password, and realized that there was no way in grafana to use it as I normally do with postman. I converted to a pem and also a base64. I tried both ways and I just cannot seemt o get it to work. My curls work, but no matter how I try entering the credentials, grafana seems to append my ‘Get’ in a way that does not work. I’ve tried just about every combination I could using the infinity datasource. For example, this curl works from my ubuntu systems without issue (I removed identifying criteria in this example) : curl --cert certificate.pem:xxxxxxxxxxxxxxxxx --pass xxxxxxxxxxxxxxxxxx -X GET ‘https://xxxx.xxxx.com/api/v1/devices?from=1&size=50

BUT, no matter how I try adding the creds to a datasource, the curl that shows as failing in the query inspector seems to show that the ‘GET’ always precedes the auth info.

Here an example where I tried using the base 64 options : curl -X ‘GET’ -H ‘Authorization: xxxxxxxx’ ‘https://monapi.ooma.com/api/v1/devices?from=1&size=50

It just fails.

Does anyone know how I can get a datasource to work using a p12 with password, a base64 token, or a pem and password???

Help is GREATLY appreciated.

Thank you!

which data source are you using?

went through all of them… but the one that fit the most was infinity. I tried all auth types… even no auth and adding headers instead, but the ‘get’ still appends to the beginning of the query and it fails. I just can;t figure it out

1 Like

which documentation did you use for infinity to configure things out?

The examples and notes on the plugin page. And google searches.
Also, Some docs I found on Git.

is this an internal rest api or a public where we can read the documentation for auth?

https://grafana.github.io/grafana-infinity-datasource/docs/authentication

Internal Rest… They are developer and provided a p12 keyfile and password. They told me to use postman, and that works without issue, because postman allows you to import the key. So I converted the p12 into a pem with password, and ran a curl to the endpoint, and it worked perfectly. Also as a base64 key. But for the life of me, can figure out how to get the formatting to work. Tried auth, tried only headers, but the ‘Get’ appends to the from of my string no matter what I try so auth fails.

1 Like

please post your working curl minus sensitive stuff

This one works perfectly

curl --cert certificate.pem:xxxxxxxxxxxxx --pass xxxxxxxxxxxxxx -X GET ‘https://xxxapi.xxxxa.com/api/v1/devices/0018616A4264

Tried the base64, doesn’t work at all. So I ruled that one out just now. :frowning:

1 Like

Thank you for assisting btw. It’s appreciated

1 Like

also check this, maybe copy paste content of your pem file and dump it here where it says begins with ------? under network tab

play around with that, if all else fails post a question in that plugin github repo

1 Like

Tried that… :frowning: Will post in Git. Thank you again for trying and your input

1 Like