aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/authentication.py
diff options
context:
space:
mode:
authorTom Christie2012-10-17 14:59:53 +0100
committerTom Christie2012-10-17 14:59:53 +0100
commit5ae49a4ec4ccfdab13bc848ecd175d44ecaf4ed1 (patch)
tree975467fd332b2dc0d89d73f2c473d9b49182662c /rest_framework/authentication.py
parent4c17d1441f184eabea9000155f07445bcc2aa14c (diff)
downloaddjango-rest-framework-5ae49a4ec4ccfdab13bc848ecd175d44ecaf4ed1.tar.bz2
Add docs for 401 vs 403 responses
Diffstat (limited to 'rest_framework/authentication.py')
-rw-r--r--rest_framework/authentication.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/rest_framework/authentication.py b/rest_framework/authentication.py
index 30c78ebc..e557abed 100644
--- a/rest_framework/authentication.py
+++ b/rest_framework/authentication.py
@@ -21,6 +21,14 @@ class BaseAuthentication(object):
"""
raise NotImplementedError(".authenticate() must be overridden.")
+ def authenticate_header(self, request):
+ """
+ Return a string to be used as the value of the `WWW-Authenticate`
+ header in a `401 Unauthenticated` response, or `None` if the
+ authentication scheme should return `403 Permission Denied` responses.
+ """
+ pass
+
class BasicAuthentication(BaseAuthentication):
"""