jpadilla / django-rest-framework-jwt

JSON Web Token Authentication support for Django REST Framework
http://jpadilla.github.io/django-rest-framework-jwt/
MIT License
3.19k stars 648 forks source link

[feature] permit to use custom header instead of `Authorization` #472

Open thomasboni opened 5 years ago

thomasboni commented 5 years ago

Permit to use another header than Authorization to retrieve token.

Current and suggested behavior

Current: this module permit only to use the standard header Authorization Suggested: permit to user to define a custom header name

Why would the enhancement be useful to most users

For example: I have a Django API which uses this module to manage authentication with JWT. I run this API in 2 environment: stage and production. Both behind a nginx proxy.

In this example, I want to use a custom header (ex X-Authorization) in order to avoid conflict and provide both header for nginx & api authentication.

Example from stackoverflow: https://stackoverflow.com/questions/22229996/basic-http-and-bearer-token-authentication