radarphp / Radar.Adr

The Action-Domain-Responder core for Radar.
MIT License
55 stars 7 forks source link

Combined fix for previous PRs #20 and #21. #22

Closed cxj closed 9 years ago

cxj commented 9 years ago

The status 400 is in error. A request needing authentication should return HTTP status 401, if I understand the standard correctly.

From Wikipedia: 401 Unauthorized (RFC 7235) Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource. See Basic access authentication and Digest access authentication.

pmjones commented 9 years ago

There's some extended discussion about this under #13. In short, a 401 response mandates that you send back a WWW-Authenticate header, which is not necessarily what you always want to do. The problem is that there is no "not authenticated" response type (as vs "not authorized" which is a different thing).

cxj commented 9 years ago

Replied under #13.