When returning a 401 the server can link to the access control resource using Link acl headers as in
HTTP/1.1 401 Unauthorized
WWW-Authenticate: HttpSig realm="/comments/"
Host: alice.name
Date: Thu, 01 Apr 2021 00:01:03 GMT
Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel=type
Link: <http://www.w3.org/ns/ldp#Resource>; rel=type
Link: </comments/.acl>; rel=acl
The allows the client to fetch the description at that resource, as described in ACLs on ACLs. In HTTP/2.0 the content could be immediately pushed to the client too using "server push", to avoid the delay of a request.
But it is also reasonable to think the server could send the content in the body of the 401 as e.g. is hinted at in Inbox discovery PR).
Argument for pushing the data:
if the client did not connect with the right authentication credentials to begin with, then it did not know or remember the rules, so one might as well send those along.
Things that need to be worked on are:
• Is that going to conflict with other reasonable uses for returning content in a 401?
• Would the content be content-negotiated? How would that work on a 401 on an image, video, ms-word document, or cobol source code resource?
• is it reasonable to assume the client understands Turtle or JSON-LD in all these cases?
• should the returned content in the 401 be thought of as the content of the ACL? (but the the conned issue above)
These types of issues tend to make the simple answer of having the client fetch the ACL document be an easier starting point, especially as HTTP/2.0 server push makes the efficiency gains moot.
Other thoughts?