Issue with authenticating custom data source plugins

Hi Team,

I am building a Datasource plugin that actually pulls data from an external API and this must authenticate using OAuth.
I have been trying to use the" Enable token authentication" method. For some reason, the grafana is not able to pull the access_token.

Here is what the log tells :

t=2021-05-11T11:45:48+0530 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/tsdb/query status=400 remote_addr=[::1] time_ms=2314 size=1560 referer=http://localhost:3000/explore
t=2021-05-11T11:45:54+0530 lvl=eror msg="Failed to get access token" logger=data-proxy-log error=EOF
t=2021-05-11T11:45:54+0530 lvl=info msg=Requesting logger=data-proxy-log url="https://io.catchpoint.com/ui/api/v1/performance/raw?tests=1640853%2C1668895"
t=2021-05-11T11:45:55+0530 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/39/getPerformance status=401 remote_addr=[::1] time_ms=2328 size=14 referer="http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22MySQL%22,%7B%22datasource%22:%22MySQL%22%7D,%7B%22ui%22:%5Btrue,true,true,%22none%22%5D%7D%5D"
t=2021-05-11T11:45:55+0530 lvl=eror msg="Failed to get access token" logger=data-proxy-log error=EOF
t=2021-05-11T11:45:55+0530 lvl=info msg=Requesting logger=data-proxy-log url="https://io.catchpoint.com/ui/api/v1/performance/raw?tests=1640853%2C1668895"
t=2021-05-11T11:45:56+0530 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/39/getPerformance status=401 remote_addr=[::1] time_ms=580 size=14 referer="http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22my-plugins%22,%7B%22constant%22:100,%22frequency%22:1%7D,%7B%22ui%22:%5Btrue,true,true,%22none%22%5D%7D%5D"
t=2021-05-11T11:46:07+0530 lvl=eror msg="Failed to get access token" logger=data-proxy-log error=EOF
t=2021-05-11T11:46:07+0530 lvl=info msg=Requesting logger=data-proxy-log url="https://io.catchpoint.com/ui/api/v1/performance/raw?tests=1640853%2C1668895"
t=2021-05-11T11:46:07+0530 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/39/getPerformance status=401 remote_addr=[::1] time_ms=538 size=14 referer="http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22my-plugins%22,%7B%22constant%22:100,%22frequency%22:1%7D,%7B%22ui%22:%5Btrue,true,true,%22none%22%5D%7D%5D"
t=2021-05-11T11:46:08+0530 lvl=eror msg="Failed to get access token" logger=data-proxy-log error=EOF
t=2021-05-11T11:46:08+0530 lvl=info msg=Requesting logger=data-proxy-log url="https://io.catchpoint.com/ui/api/v1/performance/raw?tests=1640853%2C1668895"
t=2021-05-11T11:46:08+0530 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/39/getPerformance status=401 remote_addr=[::1] time_ms=615 size=14 referer="http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22my-plugins%22,%7B%22constant%22:100,%22frequency%22:1%7D,%7B%22ui%22:%5Btrue,true,true,%22none%22%5D%7D%5D"
t=2021-05-11T11:46:08+0530 lvl=eror msg="Failed to get access token" logger=data-proxy-log error=EOF
t=2021-05-11T11:46:08+0530 lvl=info msg=Requesting logger=data-proxy-log url="https://io.catchpoint.com/ui/api/v1/performance/raw?tests=1640853%2C1668895"
t=2021-05-11T11:46:09+0530 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/39/getPerformance status=401 remote_addr=[::1] time_ms=574 size=14 referer="http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22my-plugins%22,%7B%22constant%22:100,%22frequency%22:1%7D,%7B%22ui%22:%5Btrue,true,true,%22none%22%5D%7D%5D"
t=2021-05-11T11:46:09+0530 lvl=eror msg="Failed to get access token" logger=data-proxy-log error=EOF
t=2021-05-11T11:46:09+0530 lvl=info msg=Requesting logger=data-proxy-log url="https://io.catchpoint.com/ui/api/v1/performance/raw?tests=1640853%2C1668895"
t=2021-05-11T11:46:09+0530 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/39/getPerformance status=401 remote_addr=[::1] time_ms=546 size=14 referer="http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22my-plugins%22,%7B%22constant%22:100,%22frequency%22:1%7D,%7B%22ui%22:%5Btrue,true,true,%22none%22%5D%7D%5D"

Can someone please help me understand what exactly the issue is?

I have tested with other API’s which uses oAuth and works perfectly fine, I am looking to troubleshoot this further and find the cause before i reach out to our dev team.

Hi,

Sorry for the delay–how is this going? Can you provide any more information?