Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upToken Authentication -- Manipulate Header #5107
Comments
This comment has been minimized.
This comment has been minimized.
|
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
npaschos commentedJan 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.yamlconfig. 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.