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

Token Authentication -- Manipulate Header #5107

Open
npaschos opened this Issue Jan 17, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@npaschos
Copy link

npaschos commented Jan 17, 2019

Proposal

I am using django-rest framework along with django-prometheus in order to export metrics from my app. I have exposed an endopoint and created a Token in order to authenticate the prometheus server. The token works as expected when using Postman or curl, but the issue occurs when I try to include it in the prometheus.yaml config. The header that django-rest requires in order to authenticate with a token is of the following format:

Authorization: 'Token XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

but the one created by Prometheus is:

Authorization: 'Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

Note that the former has the Token keyword included, whereas the latter one the Bearer keyword.

As expected, the authentication fails. I tried changing the header but I could not find any way in the documentation, so I assume that it is not possible.

Am I missing a config parameter? If not, I propose that this change is implemented.


Note: this is my first issue/proposal, I tried following the guidelines. Let me know if anything else is required.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jan 17, 2019

We only support standard authentication mechanisms, which your system is not. I'd suggest switching your authentication to use Bearer tokens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.