Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookie authentication does not set header Content-type #10061

Closed
heilju opened this issue Nov 4, 2021 · 3 comments · Fixed by #10404
Closed

Cookie authentication does not set header Content-type #10061

heilju opened this issue Nov 4, 2021 · 3 comments · Fixed by #10404

Comments

@heilju
Copy link

heilju commented Nov 4, 2021

Hi,

I am trying to use the inputs.http plugin with Cookie authentication. The API I want to query data from requires a header called 'XSRF_TOKEN' with an authentication token as value in the query request. The value for this header can be retrieved by doing the following POST call:

https://eu5.fusionsolar.huawei.com/thirdData/login
Header: Content-type=application/json
{
  "username": "user",
  "password": "secret"
}

The required token is returned as a cookie, but only if the Content-Type header is provided with the request. If no Content-Type header is set I receive an error.

Would it be possible to add a telegraf config option that takes a list of headers that are sent with the Cookie auth request (e.g. cookie_auth_headers={"Content-Type" = "application/json","Custom-Header" = "somevalue"})?

@aslater3
Copy link

aslater3 commented Nov 8, 2021

I have this same issue

@aslater3
Copy link

aslater3 commented Jan 6, 2022

Has anyone found a work around for this?

@grzanka
Copy link

grzanka commented May 12, 2022

@heilju Have you finally managed to use telegraf to get data from Huawei Fusionsolar API ?
It seems the issue was fixed in #10404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants