diff options
| author | Tom Christie | 2013-01-22 09:12:48 -0800 |
|---|---|---|
| committer | Tom Christie | 2013-01-22 09:12:48 -0800 |
| commit | dd10d538ffc8f76ccc670f65da2220b09c22688c (patch) | |
| tree | 1af09c7dbcc939c749d30adf25b14d232200f44f /docs/api-guide/exceptions.md | |
| parent | e29ba356f054222893655901923811bd9675d4cc (diff) | |
| parent | b7ab2aee46c718f683b19eefba1b48f233da40e4 (diff) | |
| download | django-rest-framework-dd10d538ffc8f76ccc670f65da2220b09c22688c.tar.bz2 | |
Merge pull request #416 from tomchristie/unauthenticated_response
Unauthenticated requests - 401 vs 403 responses
Diffstat (limited to 'docs/api-guide/exceptions.md')
| -rw-r--r-- | docs/api-guide/exceptions.md | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/docs/api-guide/exceptions.md b/docs/api-guide/exceptions.md index ba57fde8..8b3e50f1 100644 --- a/docs/api-guide/exceptions.md +++ b/docs/api-guide/exceptions.md @@ -53,11 +53,27 @@ Raised if the request contains malformed data when accessing `request.DATA` or ` By default this exception results in a response with the HTTP status code "400 Bad Request". +## AuthenticationFailed + +**Signature:** `AuthenticationFailed(detail=None)` + +Raised when an incoming request includes incorrect authentication. + +By default this exception results in a response with the HTTP status code "401 Unauthenticated", but it may also result in a "403 Forbidden" response, depending on the authentication scheme in use. See the [authentication documentation][authentication] for more details. + +## NotAuthenticated + +**Signature:** `NotAuthenticated(detail=None)` + +Raised when an unauthenticated request fails the permission checks. + +By default this exception results in a response with the HTTP status code "401 Unauthenticated", but it may also result in a "403 Forbidden" response, depending on the authentication scheme in use. See the [authentication documentation][authentication] for more details. + ## PermissionDenied **Signature:** `PermissionDenied(detail=None)` -Raised when an incoming request fails the permission checks. +Raised when an authenticated request fails the permission checks. By default this exception results in a response with the HTTP status code "403 Forbidden". @@ -86,3 +102,4 @@ Raised when an incoming request fails the throttling checks. By default this exception results in a response with the HTTP status code "429 Too Many Requests". [cite]: http://www.doughellmann.com/articles/how-tos/python-exception-handling/index.html +[authentication]: authentication.md |
