Skip to content

buddy.auth.backends.token/handle-unauthorized-default violates RFC 7235 section 4.1. WWW-Authenticate #83

Description

@sorsasampo

RFC 7235 section 4.1. WWW-Authenticate specifies:

A server generating a 401 (Unauthorized) response MUST send a WWW-Authenticate header field containing at least one challenge.

However, buddy.auth.backends.token/handle-unauthorized-default sends a 401 status response without a WWW-Authenticate header:

(defn- handle-unauthorized-default
"A default response constructor for an unauthorized request."
[request]
(if (authenticated? request)
{:status 403 :headers {} :body "Permission denied"}
{:status 401 :headers {} :body "Unauthorized"}))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions