Django rest framework provides a TokenAuthentication class for authentication. It validates against header in the format of Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
. The authentication scheme, Token
, seems customarily chosen. The iana auth scheme registry's list of
authentication scheme name does not include Token
as of today (2019-12-20).
Two background RFCs not mentioned in the above iana link:
So my questions are
- Is it a custom scheme, if so
- How common is it to use custom auth scheme in
Authorization
header - What is the motivation in choosing
Token
as the scheme - What other libraries also use
Token
as the scheme
To complicate matter, django-rest-framework-jwt provides a JWT authentication class , which adopt JWT
as the scheme. According to this question, the correct choice is Bearer