@@ -213,8 +213,18 @@ function initWebId (argv, app, ldp) {
213213 // TODO: remove this exception when OIDC clients
214214 // use Bearer token to authenticate instead of cookie
215215 // (https://github.com/solid/node-solid-server/pull/835#issuecomment-426429003)
216- // We only want to do this check if strictOrigin is set to false, since we trust WebACL to handle origins otherwise
217- // If we don't allow authentication with cookies we can't handle ACLs properly wrt trusted origins
216+ //
217+ // Authentication cookies are an optimization:
218+ // instead of going through the process of
219+ // fully validating authentication on every request,
220+ // we go through this process once,
221+ // and store its successful result in a cookie
222+ // that will be reused upon the next request.
223+ // However, that cookie can then be sent by any server,
224+ // even servers that have not gone through the proper authentication mechanism.
225+ // However, if trusted origins are enabled,
226+ // then any origin is allowed to take the shortcut route,
227+ // since malicious origins will be banned at the ACL checking phase.
218228 // https://github.com/solid/node-solid-server/issues/1117
219229 if ( ! argv . strictOrigin && ! argv . host . allowsSessionFor ( userId , origin , trustedOrigins ) && ! isLogoutRequest ( req ) ) {
220230 debug . authentication ( `Rejecting session for ${ userId } from ${ origin } ` )
0 commit comments