Skip to content

Commit fe910ca

Browse files
author
Tim Berners-Lee
committed
ToC
1 parent 82a31b9 commit fe910ca

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Next](https://www.w3.org/community/ldpnext/)) type systems, such as the
2929
* [Groups](#groups-of-agents)
3030
* [Public Access (all Agents)](#public-access-all-agents)
3131
* [Anyone logged on (Authenticated Agents)](#authenticated-agents-anyone-logged-on)
32+
* [Referring to Origins, i.e. Web Apps](#referring-to-origins-i-e-web-apps)
3233
7. [Referring to Resources](#referring-to-resources)
3334
8. [Modes of Access](#modes-of-access)
3435
9. [Default (Inherited) Authorizations](#default-inherited-authorizations)
@@ -351,12 +352,14 @@ and then later restrict access to that group, to prevent spam.
351352

352353
### Referring to Origins, i.e. Web Apps
353354

355+
354356
When a compliant server receives a request from a web application running
355-
in a browser, the brrowser will send an extra warning HTTP header, the Origin header.
357+
in a browser, the browser will send an extra warning HTTP header, the Origin header.
356358

357359
```
358360
Origin: https://scripts.example.com:8080
359361
```
362+
(For background, see also [Backgrounder on Same Origin Policy and CORS](https://sold.github.io/web-access-control-spec/Background))
360363
Note that the origin comprises the protocol and the DNS and port but none of the path,
361364
and no trailing slash.
362365
All scripts running on the same origin are assumed to be run by the same
@@ -365,21 +368,23 @@ social entity, and so trusted to the same extent.
365368
*When an Origin header is present then BOTH the authenticated agent AND
366369
the origin MUST be allowed access*
367370

368-
As both the user and the web app get to read or write the data, then they most BOTH
369-
be trusted.
371+
As both the user and the web app get to read or write (etc) the data, then they most BOTH
372+
be trusted. This is the algorithm the server must go through.
370373

371-
- If the requested mode is available to the public, then suceed `200 OK`.
374+
- If the requested mode is available to the public, then succeed `200 OK` with added CORS headers ACAO and ACAH **
372375
- If the user is *not* logged on, then fail `401 Unauthenticated`
373376
- Is the User authenticated is *not* allowed access required, AND the class AuthenticatedAgent is not allowed access, then fail `403 User Unauthorized`
374377
- If the Origin header is not present, the succeed `200 OK`
375378
- If the Origin is allowed by the ACL, then succeed `200 OK` with added CORS headers ACAO and ACAH
376-
- (In future proposed) Look up the user's webid to check for trusted apps declared there, and if match, succeed `200 OK`
379+
- (In future proposed) Look up the owner's webid(s) to check for trusted apps declared there, and if match, succeed `200 OK` with added CORS headers ACAO and ACAH
377380
- Fail `403 Origin Unauthorized`
378381

379382
Note it is a really good idea to make it clear both in the text of the status message and in the body of
380383
the message the difference between the user not being allowed and the web app they are using
381384
not bing trusted.
382385

386+
** Possible future alternative: Set ACAO header to `"*"` indicating that the document is public. This will though block in the browser any access made using credentials.
387+
383388
#### Adding trusted web apps.
384389

385390
The authorization of trusted web app is a running battle between readers and writers on the web, and manevalent parties trying to break in to get unauthorized access. The history or Cross-Site Scripting attacks and the introduction of the Same Origin Policy is not detailed here, The CORS specification in general prevents any web app from accessing any data from or associated with a different origin. The web server can get around CORS. It is a pain to to do so, as it involves the server code echoing back the Orin header in the ACAO header, and also it must be done only when the web app in question actually is trustworthy.

0 commit comments

Comments
 (0)