# Issue with authenticating custom data source plugins

**URL:** <https://community.grafana.com/t/issue-with-authenticating-custom-data-source-plugins/47362>\
**Category:** Grafana Plugin Development\
**Tags:** auth\
**Created:** [May 11, 2021, 6:20am UTC](https://community.grafana.com/t/issue-with-authenticating-custom-data-source-plugins/47362 "2021-05-11T06:20:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakeshr18](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@rakeshr18](https://community.grafana.com/u/rakeshr18)\
**Post date:** [May 11, 2021, 6:20am UTC](https://community.grafana.com/t/issue-with-authenticating-custom-data-source-plugins/47362/1 "2021-05-11T06:20:35Z")

</div>

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](https://grafana.com/docs/grafana/latest/developers/plugins/add-authentication-for-data-source-plugins/)" 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://grafana.staged-by-discourse.com/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://grafana.staged-by-discourse.com/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://grafana.staged-by-discourse.com/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://grafana.staged-by-discourse.com/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://grafana.staged-by-discourse.com/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://grafana.staged-by-discourse.com/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://grafana.staged-by-discourse.com/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.

 ![support-logs](https://us1.discourse-cdn.com/grafana/original/3X/e/2/e254188675e5eb0a9d8f731a19d8a35dcf5f52c8.png)

---

<div class="post-metadata">

**Author:** ![anon70503803](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@anon70503803](https://community.grafana.com/u/anon70503803)\
**Post date:** [June 28, 2021, 7:09pm UTC](https://community.grafana.com/t/issue-with-authenticating-custom-data-source-plugins/47362/2 "2021-06-28T19:09:25Z")

</div>

Hi,

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/grafana/original/2X/e/ef5308cc58c9e5a13187b5012eb99f406928462f.png) [@system](https://community.grafana.com/u/system)\
**Post date:** [June 28, 2022, 7:09pm UTC](https://community.grafana.com/t/issue-with-authenticating-custom-data-source-plugins/47362/3 "2022-06-28T19:09:55Z")

</div>

Closed on June 28, 2022, 7:09pm UTC

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
