mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-03 03:50:11 +03:00
Merge b60fb18a33
into e4144b5b67
This commit is contained in:
commit
5bd466d2d0
|
@ -142,6 +142,7 @@ class TokenAuthentication(BaseAuthentication):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
model = Token
|
model = Token
|
||||||
|
www_authenticate_realm = 'api'
|
||||||
"""
|
"""
|
||||||
A custom token model may be used, but must have the following properties.
|
A custom token model may be used, but must have the following properties.
|
||||||
|
|
||||||
|
@ -176,7 +177,7 @@ class TokenAuthentication(BaseAuthentication):
|
||||||
return (token.user, token)
|
return (token.user, token)
|
||||||
|
|
||||||
def authenticate_header(self, request):
|
def authenticate_header(self, request):
|
||||||
return 'Token'
|
return 'Token realm="%s"' % self.www_authenticate_realm
|
||||||
|
|
||||||
|
|
||||||
class OAuthAuthentication(BaseAuthentication):
|
class OAuthAuthentication(BaseAuthentication):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user