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