# Data source plugin with custom authentication headers

**URL:** <https://community.grafana.com/t/data-source-plugin-with-custom-authentication-headers/11059>\
**Category:** Grafana Plugin Development\
**Created:** [October 8, 2018, 9:31am UTC](https://community.grafana.com/t/data-source-plugin-with-custom-authentication-headers/11059 "2018-10-08T09:31:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shiro2910](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@shiro2910](https://community.grafana.com/u/shiro2910)\
**Post date:** [October 8, 2018, 9:31am UTC](https://community.grafana.com/t/data-source-plugin-with-custom-authentication-headers/11059/1 "2018-10-08T09:31:56Z")

</div>

Hello,  
I 'm developing a Data source plugin for Grafana.  
The problem is that my data source uses custom headers for authentication in HTTP API.  
When I get data from the data source, I have to add below headers to the request.  
X-User: “admin”  
X-Password: “admin”

I know that I can add headers in the client javascript. However, I don’t want to expose the user and password to the user.  
I tried “routes” field in the “plugin.json” but it does not work

```json
"routes": [
    {
      "path": "webapi",
      "method": "GET",
      "url": "{{.Url}}",
      "headers": [
        {"name": "X-User", "content": "{{.SecureJsonData.xuser}}"},
        {"name": "X-Password", "content": "{{.SecureJsonData.xpassword}}"}
      ]
    }
  ],

```

Is there any way to configure Grafana back-end to add custom headers before sending the request to my data source?

Thank you.
